Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Sottnik · Mar 30, 2017 at 04:21 PM · scripting problemaudioscenes

Mute audio in every scene problem

Hello everybody, I am new in Unity and I need your help. I wanted mute all sounds in every scene so I made Master AudioMixer and set this audiomixer as output for every audio source. I have got game with 3 scenes and I have mute and unmute button in first and last third scene. If I mute game in first scene in third scene it shows me unmute button instead mute button although music doesnt play. Here is my script in which doesnt work start method and image. Thanks for your reply I will appreciate it.

   public GameObject muteButton;
     public GameObject normalButton;
     public AudioMixer masterMixer;
     private float muteFloat = -80f;
     private float normalFloat = 0f;
 
     private void Start()
     {
         if (masterMixer.Equals(-80f))
         {
             muteButton.SetActive(true);
             normalButton.SetActive(false);
         }
       else if (masterMixer.Equals(0))
         {
             muteButton.SetActive(false);
             normalButton.SetActive(true);
         }
     }
 
 
     public void SetMusicMute()
     {
         masterMixer.SetFloat("musicVolume",muteFloat);
     }
 
    public void SetMusciNormal()
     {
         masterMixer.SetFloat("musicVolume", normalFloat);
     }


alt textalt text

mutebutton.png (14.8 kB)
mutebutton1.png (15.4 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Joe-Censored · Mar 30, 2017 at 05:07 PM 0
Share

Where you say "If I mute game in first scene in third scene it shows me unmute button ins$$anonymous$$d mute button although music doesnt play.", isn't that what you want it to do? So you mute the sound in scene 1, and in scene 3 it is still muted and you have an unmute button available. What is actually the problem you're having?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Sottnik · Apr 02, 2017 at 09:57 AM

It was switched,but i have already fixed it. Anyway thank you very much. @Joe-Censored

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

I need help with my audio slider 0 Answers

Add audio. 1 Answer

How do i change script in one scene without changing it in all the scenes 1 Answer

Slider that changes music track,Slider that controls what song is being played 1 Answer

Ingame music goes on but it should stop when you die (DeathCanvas Activate) or win (LevelComplete Canvas Activates) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges