- Home /
moving to next scene
Hi. i'm a newbie to unity3d and javascript.
i want to make my character proceed to the next scene when it hits the castle_Collider. But my code for collision doesn't work. I've already put my scenes in build settings.
here's my script.
pragma strict
function OnCollisionEnter (collision: Collision) { if(collision.gameObject.tag == "castle_Collider") { Application.LoadLevel("2"); } }
sorry for the poor english.
Answer by ynka · Jan 29, 2013 at 09:59 PM
Compare OnTriggerEnter to OnCollisionEnter . I think you need the first one. Also, does your character have rigidbody?
okay. so i'll just have to change OnCollsionEnter to OnTriggerEnter. sorry to ask this, do first person have rigid body? currently, our character is on first person mode, but we'll change it to third person afterwards after my groupmate finish creating it.
Your answer
Follow this Question
Related Questions
move to next scene 1 Answer
How to load a scene on collision 2 Answers
Scene Audio Script Error 2 Answers
Endless DeathZone??!!? 4 Answers