1

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?

enter image description here

slideshowp2
  • 63,310
  • 57
  • 191
  • 365
Tio Mob
  • 15
  • 5

1 Answers1

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!

Astro
  • 459
  • 5
  • 18