[SOLVED] How to Locate and Edit Raw Image

This is my first time using Unity and Im slowly learning the ropes. I’ve been making a puzzle escape room game, and I wish to update a hotbar slot (A raw image) upon clicking on an object. It should remove the object, then set the first hotbar image to an image of the object. I believe I have incorrectly located which raw image I wish to edit, and was wondering how i find a path to that image. The Raw Image i wish to edit is under my Main Camera, currently named “Image”

I Know when locating a Game Object, you can use the string of code:

Object = GameObject.FindGameObjectWithTag(“ObjectName”);
Is there a similar code format to find a Raw Image?
.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;

public class Interact : MonoBehaviour
{
    private RawImage Image1;
    private Camera Camera;
    private Texture Image1T;

    private void Awake()
    {
        Camera = Camera.main;
        Image1 = Camera.GetComponent<RawImage>();
    }

    private void OnMouseDown()
    {
        gameObject.SetActive(false);
        Image1T = (Texture)AssetDatabase.LoadAssetAtPath("Assets/Textures/Ball.jpg", typeof(Texture));
       Image1.texture = Image1T;
    }
}

Things like this are better to connect in inspector. Add [SerializeField] tag before RawImage declaration and the slot will appear in the script inspector. Drag the image object into that slot and it will always be there. Using things like Find and especially FindWithName hurts your game performance.

Thank you so much, that was exactly what i needed!