- Home /
Options Menu doesnt work after scene change
Hello! I recently created an options menu where you can make adjustments to your audio volume, etc. If i click play, the scene changes and everything works just fine. But when i change to the main menu scene and click on settings, i cant make adjustments. I can drag the volume slider but nothing happens...
Answer by Gpopcorn · Apr 03, 2020 at 05:34 PM
Well what I would do is create the variable static such as:
public static float volume;
and what this will do is keep the variable the same through all the scenes as well as have it able to be controlled by a slider.
$$anonymous$$y problem is not, that the audio doesnt stay the same, but when I played and go back to the menu, I can't change the volume. But when I start the game and I change the volume before playing it works, also over multiple scenes.
Answer by ahsen35813 · Apr 03, 2020 at 11:16 PM
I had a problem extremely similar to this before. The solution for me was to make sure that there was an event manager in the scene. Do you have an event manager in the main menu scene? If not, that might be the problem.
I hope this helps!
I currently don't have a event manager in my scene. When I add it, what to do next?
You don't have to do anything next. Just having the event manager in the scene should resolve the issue.
Your answer
Follow this Question
Related Questions
How do i add an extra menu to my main menu (I'm a Beginner programmer!) 1 Answer
Using scene created with SceneManager.CreateScene during runtime 0 Answers
Background hides text. How to solve that? -1 Answers
Modify Scenes in EditorBuildSettings.scenes via script 0 Answers
Is it possible to force m_name to be first setting in unitys yaml based scene files? 0 Answers