Radon
1
Hello Unity Community,
This might be off topic, but I would like to say that I am so grateful for the help I have had from this community in the last couple of days, since I just joined.
Now, I need help with the following if anyone may help:
I would like to create a spot so that when my first person controller stands over it, it plays level 2. Thank you.
- Create an empty gameoject with a box collider set to isTrigger = true
- Place the object where you want to load the next level
- Write an OnTriggerEnter function in a script that you attach to the game object - this should
- Check that the thing entering is the Player by checking the tag of the collider.gameObject entering
- Call Application.LoadLevel(levelName) when the check passes
This assumes that your player has a collider and a rigidbody (which can be set to isKinematic = true).
function OnTriggerEnter ()
{
Application.LoadLevel (“scenename”);
}
That Should do the trick