Quantcast
Channel: Questions in topic: "stay"
Viewing all articles
Browse latest Browse all 18

OnTriggerStay not working properly

$
0
0

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;

        }

    }

}

Viewing all articles
Browse latest Browse all 18

Trending Articles