|
Hey guys I created some booleans, if theyre setted to true the will unlock the other levels. The problem is that when I change the scene and come back the are setted to false again. Any ideas on how to keep them in true once I complete the level? I need to make the variable remember the event.
(comments are locked)
|
|
Attach the script to an empty gameObject and add DontDestroyOnLoad would do the trick. Edit for further explanation: Your script already 'remembers' values you feed to it, it's just that the script gets destroyed when you load a new scene. I take it you already have the script attached to something in your scene, now when you add DontDestroyOnLoad to this script it will 'survive' scenechanges. It failed, the script mut be attache to a GUITexture. Any ideas?
Mar 16 '11 at 03:03 AM
Noah 1
and if you do the same but with GUITexture, attach the script to your GUITexture and add DontDestroyOnLoad
Mar 16 '11 at 03:30 AM
Uriel_96
Well I am trying to make my script remember the booleans but DontDestroyOnLoad is not member of boolean.
Mar 16 '11 at 04:03 AM
Noah 1
Edited answer. If it's still not clear then you have to spend a little time studying the site I linked to.
Mar 16 '11 at 01:50 PM
Joshua
I am going to try the game manager. Thank you.
Mar 16 '11 at 05:05 PM
Noah 1
(comments are locked)
|
