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!