Hi, I have a Main Menu and a gameplay scene in my game. In the main menu you can select a background for the gameplay. But how do I change the material of the background over different scenes?
Your main menu saves the setting to a file or PlayerPrefs and then when the scene loads in it loads in the setting and sets the background.
But how do I save this as a playerprefs?
It can have a function with different colours. The 1 is yellow, the 2 is red, the 3 is green…
The player chooses the 3 and in a PlayerPref you save the 3 and in the next scene by code you say that it is the 3 to take.
You can also use DontDestroyOnLoad, so that when you change scene that piece of code will survive for the next scene.
1 Like