Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Seamless music question.

Discussion in 'Scripting' started by itsdandd, Jul 18, 2020.

  1. itsdandd

    itsdandd

    Joined:
    Jan 6, 2020
    Posts:
    44
    I was watching this video and it finally solved my problem. But when you mute then come back you have to press the button twice for it to un mute. Any clue why?


    Thanks!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,954
    Gotta debug it from the ground up.

    Is the button dimming out when you touch it the first time?

    Is the delegate hooked to the button being called on the first press? Put a Debug.Log() there.

    If you make another button next to it and a trivial "You pressed me" delegate, does it fire after one click? Or does it also require 2 clicks?

    When you take focus away from the Game window in the Unity Editor, it takes one full click in the Game window before subsequent clicks work. That's another factor to consider.

    Debug.Log() is your friend. Sprinkle liberally.
     
    seejayjames likes this.
  3. itsdandd

    itsdandd

    Joined:
    Jan 6, 2020
    Posts:
    44
    The button is not dimming out. I am not sure how to use the debug.Log() because I am unfamiliar with C Sharp. Thanks for replying!