I am very new to scripting games and I need help getting my character to die when he falls of the edge I have tried just importing the scripts from Unity's tutorial but it wont work I really need help.
Hi Tracey P,
For the fallout block, make sure that it is a trigger. After that, make sure that it is tagged "fallout" (minus the "") or whatever you want the tag to be.
Then in your character script put:
function OnTriggerEnter(hit : Collider)
{
if(hit.gameObject.tag == "fallout")
{
dead = true; // put your death script here
HealthControl.LIVES -= 1 // subtract health here unless your death script takes care of that.
}
}
if you are following the TornadoTwins youtube videos, then put that in the MoveAround.js file.