- Home /
Question by
mmmeeeggg · Mar 22, 2014 at 04:41 PM ·
javascriptmonodevelopscenesunity4load level
How do i say, if ball is -5 and scene is "MainGame1", go to scene GameOver1 ???
This is the script i have for "MainGame" but i want to add another if statement underneath.
function Update () {
if(transform.position.y < -5) { mainGameScript.GameOver();
} }
What i want to do is add on that if position is -5 and i am in scene "MainGame1" then application.LoadLevel ("GameOver1");
Comment
Best Answer
Answer by getyour411 · Mar 22, 2014 at 04:41 PM
You want two things
1) the && signs for AND
2) the application.loadedLevelName
if(-5 && application.loadedLevelName == "....")
Your answer
Follow this Question
Related Questions
Can't Use MonoDevelop 3 Answers
I know javascript but i don't understand Unity's javascript! 1 Answer
Cannot see javascript files in Monodevelop Unity 5.2 1 Answer
Cant get Monodevolop to work 0 Answers
Unity3 Monodevelop Autocompletion 2 Answers