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);
}
↧