My game has a scene that has the option to select the character, but when I go to the other scene I can't get references from the previous scene, so how do I know which character was chosen from the previous scene and put to appear in the new one?
Asked
Active
Viewed 1,609 times
1
-
Does this answer your question? [Unity - pass data between scenes](https://stackoverflow.com/questions/32306704/unity-pass-data-between-scenes) – Draco18s no longer trusts SE Nov 24 '19 at 04:32
1 Answers
0
welcome to Stack Overflow!
Unity provides a cool thing called PlayerPrefs, and it also saves on your local disk when you leave. Here's an example of a game I made using PlayerPrefs: infinitecarspeeder.netlify.com. I would make a method when you hit the button, it sets a PlayerPref named skin:
PlayerPrefs.SetString("ChosenSkin", "Josh");
If you do not want your player's skin to save when you leave:
PlayerPrefs.DeleteKey("ChosenSkin");
For more info, see this link: https://docs.unity3d.com/ScriptReference/PlayerPrefs.html
Hope it helps!

randomcoder
- 626
- 7
- 20