Is there a way to create a variable that doesn't get reset when exiting to the main menu? I'm working on a feature that displays a selection when the variable's value changes, but the variable always resets when returning to the main menu, so I can't implement this feature.
You can e.g. use PlayerPrefs to store values outside the variable system - schematics have nodes to use/change them and all value type fields (e.g. for int/float values) can use them as well.
Alternatively, you can try setting up an option in UI > Option Categories that's saved with the options file, but changing the variable would need to go through an options menu to save the change.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
They're not shared across different plays, e.g. each new game you start will have it's own variables.
For persistent values you need to use PlayerPrefs.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!