Search Unity

Resolved Audio sources not playing

Discussion in 'Scripting' started by seejayjames, Aug 14, 2020.

Thread Status:
Not open for further replies.
  1. seejayjames

    seejayjames

    Joined:
    Jan 28, 2013
    Posts:
    691
    In a project I've been working on, suddenly no AudioSource will make sound, whether it's called by script or I set Play on Awake and Loop to true. I've removed them and put them back, assigned the clips, nothing. The clips preview fine in the Inspector. If I add an AudioSource in a different scene it works. AudioSources in other projects work fine. This literally happened just now, everything was fine yesterday...

    Is there a setting somewhere I should look at? The Audio Project settings are all default (Disable Unity Audio is of course unchecked). AudioListener is on the main camera and is active. Mute Audio is unchecked. Some kind of corrupt preference somewhere? Should I copy everything to a new project? This makes no sense...why does it not work in that specific scene? Thanks for any insight, I'm tearing my hair out...
     
    Rispat-Momit likes this.
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    If it's not working in editor, make sure you didn't accidentally mute your game.

    upload_2020-8-14_15-38-6.png
     
    SamohtVII, G_hi3, haardyy3 and 11 others like this.
  3. seejayjames

    seejayjames

    Joined:
    Jan 28, 2013
    Posts:
    691
    Never mind, it seems to have fixed itself. Not sure what I did. Something was screwy with the initial state of the AudioSources while my main script was active. If I disabled an AudioSource and then re-enabled, it would play. Very strange and a possible bug, but the script is pretty complex so I don't think I could nail it down. Anyways, thanks all.
     
    Last edited: Aug 15, 2020
    Kurt-Dekker likes this.
  4. seejayjames

    seejayjames

    Joined:
    Jan 28, 2013
    Posts:
    691
    Oops, been editing the same post as I made progress, I should just reply so the thread is all there. Will do next time.
     
  5. arkenstn

    arkenstn

    Joined:
    Dec 17, 2019
    Posts:
    3
  6. HammadShah01

    HammadShah01

    Joined:
    Mar 7, 2021
    Posts:
    1
    Thankyou sooooooooo much bro... Savior
     
  7. pawaleomkar86

    pawaleomkar86

    Joined:
    Oct 13, 2022
    Posts:
    1
    Thanks man !!! i spend a lot time changing code and settings ... you were saviour
     
  8. RockStar89

    RockStar89

    Joined:
    May 6, 2018
    Posts:
    3
    @Brathnann Lol - I muted my game in the inspector. Thank you.
     
Thread Status:
Not open for further replies.