- Home /
Mute/Unmute Sound For All Game Scenes by pressing Button
My Question is simple i just want to Mute/Pause All Sound of the Game having different scenes.
From Scene 1 Which is a Main Menu I Have Two Button On/Off . When i press On Button it stops or mute full game sound or music like Car sound etc in all Scenes. When i press off button then Sound become active again in all scenes ..
I'm new in this field so please give me some help My Game is almost Complete But i can not Control or Mute All scene Sound at the same time..Waiting
Answer by Yoshinator2 · Jul 30, 2017 at 08:20 AM
Create a static script and run DontDestroyOnLoad(); in the start or awake function. This will keep the object throughout all scenes. Then, just have the script remember whether or not the player muted or did not mute the sound, and on the Awake() function, just have it set the audio to muted or not.
If this solved your problem, please accept my answer :)
Please Give me the whole Script ... I'm new in this field So Please ..And i Accept you'r Answer ...Please Please