- Home /
when i load scene, it starts same scene over
for some reason... the little cut scene i made that plays a single animation that triggers an on trigger enter that loads the next scene loops. i have all scenes already in the build. it starts on scene one... then plays the animation... the animation hits the trigger... #pragma strict
function Start () {
}
function OnTriggerEnter () {
Application.LoadLevel("deathscene2");
} and it loads the new scene for a fraction of a second and just starts the first scene again... why is this doing this? it worked a few days ago. each scene would trigger the next and it was smooth. now it goes... deathscene1,a blip of deathscene2, then imediately back into deathscene1 as soon as the trigger is hit again. please help!
i fixed this issue. for anyone else who may stumble into this stupid little mistake... here it is. i feel dumb. seeing as how all my levels are clones of each other with varying enemy variables... the script i used to check if all enemy's were dead was carrying over into my scenes. so therefore upon loading the new scene each scene would read that script and jump me back to the level the script was told to load. i know that is confusing...but i don't know how else to word it.
Your answer
![](https://koobas.hobune.stream/wayback/20220613110528im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Float var not decreasing when reload a scene 2 Answers
When ai touches gameobject reset scene. The code does not work any suggestions 2 Answers
Button OnClick() Scripts lose assignments on scene reload 1 Answer
Objects still in scene on loadscene? (creating objects on destroy?) 0 Answers
Reset timeSinceLevelLoad? 0 Answers