I need help scripting this Scenario:
My character enters a trigger [a cube named “Trigger_A”] which causes a GUI Text to pop up namely “You Die” and he returns to a scene named “Main_Menu” after about a few seconds.
I have a health script installed in my character
I’m Making a game for an event and I’m 14 so I’m a Newbie at Scripting
Thank You in advance for your help
Ok…
var deathMsg : GUIText;
function OnTriggerEnter (other : collider) {
if (other.gameObject.name == "Trigger_A")
{
deathMsg.SetActive (true);
yield WaitForSeconds (4);
Application.LoadLevel ("Main_Menu");
}
}
However, if you didn’t understand every word and punctuation mark in every line of the above script, then you are not prepared to make even the simplest game, and you need to take a step back and read the manual thoroughly before you try to proceed further.
Depending on when this event is, you may not have enough time, and should probably find someone IRL to help you.