Can you use a cube to bring up a UI?

Any help with this will be super appreciated because I am getting no where on my own.

What I want to do is click on a cube which will bring up a UI canvas, which will then play a movie.
So far I can click and bring up the canvas (with my movie playing), but I can click anything and it will bring up the canvas.

This is my script:

public class ClickCube : MonoBehaviour
{

Canvas canvas;

public GameObject Clickcube;

void Start()
{
    canvas = GetComponent<Canvas>();
    canvas.enabled = false;
}

void Update()
{
    if (Input.GetKeyDown(KeyCode.Mouse0))
    {
        Pause();
    }
}

public void Pause()
{
    canvas.enabled = !canvas.enabled;
    Time.timeScale = Time.timeScale == 0 ? 1 : 0;
}

}

At this point I am beginning to wonder if using a cube to bring up a UI is even possible! Also, I’m pretty new to Unity so any help at all will be amazing. Thank you!

You misunderstood how Input.GetKeyDown works.

     if (Input.GetKeyDown(KeyCode.Mouse0))
     {
         Pause();
     }

This will be called whenever you left-click, not when you left-click on the GameObject this script is attached to.

To detect if you actually clicked your GameObject, and not just a random point of the screen, you’ll have to use a Raycast.

First, you detect a click, just like you already do, then you check what you hit with that click.

    void Update () 
    {
        if (Input.GetMouseButtonDown(0))
        {
            // Create a ray going from camera to the screen point 
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
                
            // Check if the ray hits a collider
            if (Physics.Raycast(ray, out hit))
            {
                // Check if the collider we hit is attached to the current GameObject
                if (hit.collider.gameObject == gameObject)
                {
                    Pause();
                }
            }
        }
    }

Don’t forget to add a Box Collider to your cube, and you’re good to go.