#How get varibles form other scenes into one scene

1 messages · Page 1 of 1 (latest)

modest pewter
#

i want to get a level system but i need varibles to get the levels done or not

sterile gull
#

Generally, there's 3 ways of making variables persist between scenes:

  1. Place the script containing the variable(s) on a DontDestroyOnLoad object
  2. Make the variable(s) static
  3. Store the variable(s) on a ScriptableObject
sterile gull
# frigid fractal You can use playerprefs

PlayerPrefs are very limited in what they can store.
They also are meant to hold preferences, not game data.
And on top of that, they are not supposed to be used for caching, but for storing persistent values.

frigid fractal
#

Does static variables value reset after closing the game?

sterile gull
#

Yes they do.

mortal gust
sterile gull
mortal gust