How can I load sprite from previous scene?
Hi guys. So, here is my problem. I created character selection scene with buttons (those sprites are buttons). All three buttons represent three different character sprites. How can I load selected sprite into next scene, so player can be this selected sprite? For example, I choose princess button and in the next scene my player appears as a princess etc. Now I just attached Debug.Log functions to each of them (for example: "Selected player: Chanelena"). Thank you for your support.
Answer by reineinmyheart · Feb 13, 2016 at 11:05 AM
There are many ways to do this. You can start off by creating a Game Data manager of some sorts, that would store the data of the selected character, and this object must be accessible through the next scene, so some other object from that scene would load the data off of it. See DontDestroyOnLoad script reference
There are also a lot of character selection tutorials out there, I suggest giving them a go or try searching for them on google, I'm pretty sure a lot of them would come up. It would be too long of an answer to explain every aspect of the character selection here, so I suggest watching/reading some tutorials about it instead. Tutorial 1 Tutorial 2
I hope I at least, gave you some idea.
Your answer
Follow this Question
Related Questions
Problem with saving player data 0 Answers
Correct Call function On Gui ? 0 Answers
Main Menu Help 2 Answers