- Home /
OnTriggerStay not working properly
I have an object that when the player is touching it and they press a keyboard button, it will load a new level, this seems to work in the unity player, but when I do the same thing on the proper thing (Build and run), it doesn't do anything. here's the code:
function OnTriggerStay(other : Collider) {
if(other.gameObject.CompareTag ("Player")){
if(Input.GetButtonDown("Activate")){
Application.LoadLevel(1);
Screen.lockCursor = false;
}
}
}
Answer by MonkeyAssassin8 · Dec 14, 2010 at 04:19 AM
Turns out, changing Input.GetButtonDown to Input.GetButton made it work perfectly
Answer by Berenger · Dec 13, 2010 at 12:11 PM
Only thing I have in mind : Are both level included in Build Settings ?
Your answer
Follow this Question
Related Questions
OnTrigger/Collision 1 Answer
Changing current audio on trigger. 1 Answer
Not Quite Sure How OnCollision... Works 1 Answer
on trigger enter 1 Answer
OnTrigger events on multiple objects 1 Answer