Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Display message when collide with object?

$
0
0
Hi there, I'm new to Unity and JavaScript, basically I want to display a GUI I have set up in the Canvas called MessageBox when I collide with this object, I have the GUI deactivated but want to activate it when I collide with this object, If anyone has a solution Id really appreciate it. JavaScript please as I don't know C# import UnityEngine.UI; function OnTriggerEnter (info:Collider) { var pickUpAudio : AudioSource = GetComponent.(); pickUpAudio.Play (); PickUpSystem.itemCollect +=1; transform.position = Vector3(0,-1000,0); yield WaitForSeconds (1.5); Destroy (gameObject); var MessageBox : GameObject; MessageBox.SetActive (true); }

Viewing all articles
Browse latest Browse all 1875

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>