First of all, sorry for the nooby question, been learning unity for around a week or so.
So, I have two scenes in my (2d) game currently, one for my main menu, one for the game itself. I have a working settings page on the main menu, but i’m having trouble bringing the settings page into the game if that makes any sense. Like I want to be able to open the same settings page within my game’s pause menu as well as on the main menu. I tried to create a prefab of the settings page and load that in both the main menu and game, which somewhat works, but how can I “sync” them together so to speak. Sorry if this is incredibly obvious, I’m not the brightest bulb haha. My guess is that I would need to create some sort of script to load the settings in both the main menu and pause menu? or is there an easier / more simple way of going about it?
This is definitely the reference way to do it in Unity.
I don’t know what you mean by sync but ideally 100% of the function of the settings is contained 100% within the prefab hierarchy.
When you change it, only change the prefab by double-clicking it in your project. DO NOT change any part of the prefab in the scenes that use it and you won’t have to worry about them getting out of sync.
Hey so, I understand prefabs a bit better now. But I’m still having the problem with my settings not being in sync upon changing a setting. I’ll try to explain better.
Lets say I load up my game, on the main menu scene I go to my settings page and turn the volume down. Now I click the play button and get in the game scene, I go to my settings in game, the volume slider is now back to its default value, but the volume level itself is still at the value I set in the main menu, and it still changes volume when I use the slider, but the default values it shows when I open the settings is wrong. Is this simply just a problem with not updating the default values upon changing a setting in my script?
This helped a lot, I’m very new to all this so I overlooked quite a bit. Thank you for breaking it down for me, I’ve figured it out now. Tysm. Have a good rest of your day / night