Script problem after changing scene
I work on a project with SteamVR plugin and multiple scenes. All scenes work as expected, when I start them in playmode BUT when I switch scenes in playmode and come back to one of my scenes, this specific scene seems to be broken i. e. its loading correctly and everything is there, but the behavious I scripted for the objects in the scene aren't working anymore.
For example: Several gameobjects are instantiated via script and normally I can click on an object and it is added to a List when the list reaches a specific count a bool value will change and an animation will be triggered. As I said, everything works fine, when I start the scene, but as soon as I switch between scenes in playmode and come back to this scene I still can collect my gameobjects to the list, but the bool won't be set anymore.
As far as I know everything is deleted after I change a scene, so there shouldn't be any differences when I come back to this scene?! I explicitly change with LoadSceneMode.Single. And there is no DontDestroyOnLoad used in any of my scripts. I also unchecked the DontDestroyOnLoad on my SteamVR player prefab.
Your answer
Follow this Question
Related Questions
The referenced script on this Behaviour is missing! 3 Answers
Animator StateMachineBehaviour scripts are collapsed in inspector 0 Answers
The referenced script on this Behaviour is missing: Changing scenes. 0 Answers
Agent setDestination problems in an Animator Behaviour 0 Answers
how to use RunCoroutine in Unity 2D Gamekit Behavior Tree 0 Answers