- Home /
destroy object after Application.LoadLevel
how would i destroy the object/trigger after i have entered the level, so when i return back to that scene i cant return to the previous scene.
function OnTriggerEnter(){
Application.LoadLevel("scene2");
}
I don't understand...
when you load a new level, your old level is unloaded...
So, what trigger are you talking about?
well the first scene has 12 levels you can enter, so when you enter the first level(1) and then return to the scene with 12 levels i want to make it so you cant re-enter the first level, does that make sence?
Answer by midomido · Aug 18, 2013 at 01:11 AM
when you want to make the first scene not enter-able call this to set it
PlayerPrefs.SetInt("FirstSceneFinished",1);
and when you get in your scene with 12 levels check this first and it will tell you if scene 1 is finished or not
if(PlayerPrefs.GetInt("FirstSceneFinished") == 1)
{
//First Scene Finished
}
else
{
//First Scene Not Finished
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613112424im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Level Fade Help! 2 Answers
Application.LoadLevel not loading levels 1 Answer
Post-Build Custom Level Loading 2 Answers
Exiting from a scene properly 1 Answer
Saving score to next level? 3 Answers