hi guys, i want to pass a boolean variable from a scene into another scene. when am trying to load into previous scene the properties for the variables are destroying?
how can i avoid this?
i have already used DontDestroyOnLoad(this); but its not seems good...
is this any chance to pass variables with DontDestroyOnLoad function....?
can any one help me?
asked Nov 08 '10 at 11:11 AM
Use DontDestroyOnLoad(gameObject); to keep the GameObject the script is on alive
Alternatively, you could make the boolean value static, so it persists no matter whether the script is destroyed or not, but that'll stop you from being able to assign to it in the inspector
answered Nov 08 '10 at 12:32 PM