Carrying values between scenes?
-
How do I carry a value (i.e. a score) from 1 scene to the next?
-
@Aceboss So I managed to achieve it via the ‘modify save file’ and ‘load file’ behaviours, in case anyone else is looking for the means of doing it.
-
Another way you can do it is to place an object on your UI layer, and store the value on that object. It should then exist in all scenes.
-
@Murtaza I haven’t had too much luck with that. I.e. if I set an attribute on an object in the global ui in scene1, and then get that attribute in scene2, the value returned is the default, not what was set in scene1 - any ideas?
-
@Aceboss When switching scenes, make sure
refresh
is disabled. If that is enabled, all GUI objects reset when a different scene is loaded. -
@RobinsonX Thanks, that was it!