Helloooo
I am using the Cardboard clicker to move the Camera, Done √
But want to use the Raycast hit from the Camera to trigger smaller events.
What’s wrong with the following code:
private Camera cam;
public GameObject trigger;
public bool myTrigger = false;
public GameObject myShow;
// public GameObject myHide;
// Update is called once per frame
void Update () {
if(Physics.Raycast(cam.transform.position, trigger.transform.position, Mathf.Infinity)) {
if (myTrigger == false) {
myShow.SetActive (true);
//myHide.SetActive (false);
} else {
myShow.SetActive(true);
//myHide.SetActive(true);
}
}
}
Thanks!
~be