Application.LoalLevel doesn't reset everything??

Hi there,

I’m having a bit of trouble with Application.LoadLevel.
It seems that if I load say “Level A”, then “Level B”, then reload “Level A” it doesn’t completely reset level A.
Does anyone know why this is happening? I kinda thought reloading a level would reset it essentially. Is there a way to do that?

Thanks
Pete

Do the objects that don’t “reset” have a DontDestroyOnLoad attached to them?

It will load level A completely new. However, there are two things that won’t reset: static variables and objects that you set to DontDestroyOnLoad. It is likely you are using either of those. To fix it, you will need to reset your static variables and destroy your DontDestroyOnLoad objects from a script just before loading the level.

Thanks, guys. I have static vars in a few scripts. I’ll have to make sure to manually reset them.