Question by
Spacetato · Nov 24, 2015 at 07:55 AM ·
colliderscenescenesscene loadscene change
I have several scenes in 3D, and I want them to change after colliding the player with an object. How do I do this?
Preferably using Javascript, what script would I need, to change one script to another upon collision?
More specifically, every game level is made so that the character travels through a maze-type thing in order to collect crystal shards and the main goal - a marble. How can I make it so that the next level starts once the character collides with the marble?
Thanks in advance.
Comment
Answer by Jessespike · Nov 24, 2015 at 06:16 PM
function OnTriggerEnter (other : Collider) {
Application.LoadLevel("some scene name");
}
Be sure to enable "Is Trigger" on the marble's collider.