Passing Data between different Scenes in Unity (Static Variable)

  • Using Static Keywords
  • Using DontDestroyOnLoad function
  • Saving to local storage(file) and load inside another scene.
  • Using ScriptableObject

Public vs Private vs Static Variables

Using Static Variables to Transfer Data in Unity

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store