- Home /
Problem Changing Scenes
I am using a script called ChangeScript attached to a box collider to try and change scenes, this is the script: function OnTriggerEnter (other : Collider) { if (other.tag = "player") { Application.LoadLevel ("Bunker") } But when I try to use it, it says "Script ChangeScript has not finished compilation yet." even though I've waited for around 10 mins. What am I doing wrong?
Answer by PH-zero · Feb 11, 2013 at 09:25 PM
Ah! I had the same problem. I think i know what to do.
This has nothing to do with time. There has to be an error like a missing semicolon or somthing like that.
You have to care about any errors or problems before you can attach a script to an Object.
And just an idea, you could use this if you want:
function OnTriggerEnter (collision:Collision) {
if(collision.gameObject.name=="Player"){
Application.LoadLevel("Bunker");
}
}
If you want to use this script the name of the player-object has to be "Player"
I hope my answer will help you =). If it's not working, feel free to response.
Oh! ups... it has to be:
function OnCollisionEnter (collision:Collision)
if it's a boxcollider, and:
function OnTriggerEnter (collision:Collider)
if it's a trigger. sorry about that ^^
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Why is my script still running in other scenes? 1 Answer
Getting audio.PlayOneShot to work 2 Answers
Unity 3d(Space) Questions 1 Answer
Scene changing 1 Answer