- Home /
objects not reappearing
hi, this might sound silly but im getting this really weird error i have 2 scenes in my game game1,score so when i finish the game it goes to the score scene im using
`Application.LoadLevel("score");`
and in score i have a replay button that does exactly the same
Application.LoadLevel("game1");
so sometimes when i go back to game1 (this does not happen always) some of my objects are not getting created, i thought they stayed in memory and so there was an error recreating them so before loading the next scene i deleted the scene like this
Object.Destroy(this);
Application.LoadLevel(score);
but its not solving it any idea how to solve this?
its like this i have a scene that has 2 boxes and 2 game objects with colliders (this is just an example) when i go to scene score and then back to game1 the colliders in the gameobjects are lost thats basically whats happening
thank you in advance
Answer by rutter · Apr 01, 2012 at 12:51 AM
sometimes when i go back to game1 (this does not happen always) some of my objects are not getting created
Are these objects which you created after the level was loaded? If so, it's entirely normal that they're not reappearing.
You should get the same state each time you load a level. Is that not the case for you?
sadly they are all made when the level is loaded they are all created manually and not with code :S and yes i get the same state almost always but there are times when the bug happens and i have seen it in some other games got no idea how to fix it
Answer by juliocrivera1 · Apr 20, 2012 at 08:19 PM
at last i found the error the thing is when you replay the level sometimes some colliders are not working even if they are enabled so to solve it you have to make em triggers and just remove the trigger and get them to be normal colliders again