- Home /
Trouble with a respawn script
I'm making a 2D game for my Uni project and I'm a games design student and i don't do much programming but I've come to like JavaScript and the problem is for some reason it wont reload the level when enter the trigger.
This is the script
function OnCollisionEnter (collision : Collision) { if (collision.gameObject.name=="Player") Application.loadLevel(Application.loadedLevel); }
Also if any of you know how I could level up when go into the trigger at the end of the level that would be great.
Answer by getyour411 · Feb 20, 2014 at 04:01 AM
Please format your code using 10101 button
Capitalize L in LoadLevel
is the variable "loadedLevel" defined and in your Build Settings
Do you use something with DontDestroyOnLoad on scene transitions (for the Level++)
Your answer
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
How to check if car entered garage... then if true, do a specified function ? -1 Answers
Setting Scroll View Width GUILayout 1 Answer
BCE0019: 'collision' is not a member of 'Object'. 1 Answer
OnTriggerEnter - destroy (this.gameobject) if it collides with anything 2 Answers