Is it possible to use Autoload/Autosave without defining a scene? For instance, my Main Menu has a currency stored in global variable. I want that currency carried over to the next scene. Is it possible to use Autoload by loading only the global variables without loading a predefined scene? I currently carryover the variables by storing the variables in a game object with DontDestroyOnLoad, transfer it again to the global variable once loaded (let's just say I need it as a Global variable) but with lots of variables to juggle my architecture is gradually starting to bloat. Many thanks!
  • Variables will get reset upon new game or load game, so you'd have to either do it as you currently do, or use PlayerPrefs to store them.
    Beside that, global variables will still be there even when changing scenes and are only changed when you actively change them somewhere (e.g. a game event).
    If you're enjoying my products, free updates and support, please consider supporting me on patreon.com!
  • Does it mean that global varibles generated by Makinom are static?
  • edited August 28
    No, global variables are just kept alive throughout the entire game, i.e. available at all times and from everywhere. They're also saved in save games.
    Post edited by gamingislove on
    If you're enjoying my products, free updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.