- Home /
I want help figuring out how to change multipule sprites images by clicking a button that in another scene
In my game I want it to be that you can set a specific character as your background in the game, lets call it scene1. When you go to another scene (lets call it scene2) where it shows a multiple buttons and when you click on one of the buttons it should set the sprite image in scene1 to that character. I was hoping to incorpriate a scriptible object to save the data for each character (which I have already made and it stores sprite images and a audio) so the button should use the data to apply it to the sprites in scene1. I often see this feature in rythem games and really want to incorpreate it into my game.
I am sort of new to Unity so I apologize if this is confusing to read.
Answer by Batuhan13 · Jun 05, 2020 at 02:49 PM
Hi mate you should use Player prefs and you should follow this algorithm->
Step 1=Add a new script to scene1=if(PlayerPrefs.GetInt==1){//Change Sprite}
Step 2=Add a new script to scene 2= if(_isButtonPressed==true){//Increase PlayerPrefs value to 1from 0}
I hope you will got that.Have a great day
Your answer
Follow this Question
Related Questions
Multi Button Script Help 1 Answer
Highlight images in buttons children 0 Answers
override touch control when pressing a button (android) 0 Answers