I am currently working on a horror game in unity and I ran into a problem. If anyone can help me out with this, I would really appreciate it! In the game, the Player is going to be walking through a hall and there will be a tigger zone (OnTriggerEnter) right before an intersection in the hallway. When the player hits that trigger zone, a gameobject will rush through the intersection (In front of you.) So really what I’m asking is, Is there a way to make a gameobject move when you enter a trigger (OnTriggerEnter)? If there is a way to do this, I would really appreciate some help. If there isn’t a way to do this, do any of you guys have a different solution? Thanks for your help! I REALLY appreciate it!
var isInTrigger:boolean=true;
function Update(){
if(inInTrigger)//Get The guy going
}
On the trigger box:
var script:WaitingScript;
function Start(){
script = GameObject.Find("WaitingGuy").GetComponent(WaintingScript)
}
function OnTriggerEnter(other:Collider){
if(other.gameObject.tag=="Player")script.isInTrigger = true;
}