When I run the scene in the editor, there is no sound. However, sound will kick in when I pause and un-pause the menu. This is not a problem if I build and run the scene. Is this a bug with the editor or am I missing some kind of component?
Yeah, the main camera has an audio listener and the bug still happens. Another weird effect is if you engage dialogue, no sound plays. However, if you pause and un-pause during the dialgoue, all of the previous chars of sound play back over each other at once.
But is the AudioListener enabled when the bug occurs? It's either that or your volume levels - what are the sound levels like when you go into the in-game Options menu?
I'm assuming this is only happening in the Editor and not builds, correct?
We'll need to determine if this is a general problem with audio, or unique to AC. Try playing a regular AudioSource component in your problematic scene without involving AC or it's own Sound system.
Just tested the scene with an audio source playing a looping sound. The game is mute on starting the test, and once I pause and un-pause the menu, the loop actually begins. It's as if all sound is just not set to run until the menu is un-paused, and this only happens on all consecutive tests after the first one when the project is loaded.
Are you using the Sound: Play Action in your scene's OnStart Cutscene to play the sound, or just relying on the AudioSource's Play on awake checkbox? Try this if you weren't before.
Unity Ver. 5.3.6 / AC Ver. 1.52a & I can confirm that this is still happening:
My Player has a ‘walk’ sound clip applied exactly as in the tutorials
My Player is FP with no mesh attached but has animation, camera and a capsule collider (and the relevant sound child) – this all works fine (Normal interactions including “Look at” and AC functionality)
I also have a triggered SFX sound later on (Based exactly on the “Camera switch” example in the 3d video tutorial.)
Symptoms:
Run in editor – No sounds from either the players walk loop or the triggered sounds until the game is awoken from a pause. (Either (Esc) menu or Action list / Cutscene end)
“Sometimes” Sound will work OK on the first Editor Play-through… (it is NOT always : it depends on how much you have done in the editor and if you have /have not saved your scene (Works prior to a save)
Running in full build (standalone Win/Mac/Linux) is fine – with or without a scene prior to the scene with the audio in it. (Which is consoling – and proved that I was not going entirely do-ladley…)
In the editor the scene “sound” button is enabled – but becomes greyed out during test play , and the mute button is “unchecked” (sound on) during the whole test.
When the sound component on the player is visible during test – the Audio clip “walk” shows in the inspector as it should…. (but no sound)
I have no “on start” cutscenes – because I have a full introductory scene prior to the ‘Main event’ – although for my own sanity I would be happy to have one just to fire up the audio : but I don’t know how to build that yet and have not got the time ATM…
My Main Camera Audio listener remains on during the entire test.
What is interesting is that the “Play on awake” on the “Player’s” Audio source becomes Unchecked as soon as the scene is started – Regardless of editor settings OR having it saved to the prefab (So having it checked or not seems to make no difference!)
So it would seem this is a Unity Editor problem & I am reporting (as such) to bring this thread to "semi answered" conclusion : Unless anybody has found a cure – for which I personally would be grateful – If just to make development easier & to avoid catching any more red herrings & wasting loads of debugging time…
Thank you for bringing it to attention. From the symptoms, it does appear to be an issue with Unity rather than AC, but I don't want to write it off just yet. But the fact that sometimes it works / sometimes it doesn't does make it difficult to recreate and pin down.
You mention First Person - UFPS or AC vanilla? The only related thing I can think of is the AudioListener.pause calls that AC makes 3 of:
UltimateFPSIntegration.cs, line 132
SceneSettings.cs, line 259
StateHandler.cs, line 397
Try temporarily commenting out those lines and see if that makes a difference.
I am not using UFPS - Its AC Vanilla ( 'ish ) - no model : only the collider , if by Vanilla you mean the AC 'player' attached components - yes it is :-)
All three commented out (then, one by one & two by two in case of conflicts) and no change - which is 'good' - no sound at the start on any combination...
StateHandler- lost sound completely (no sound on a resume because it was not re-set by the HasGameStateChanged() due to the commenting out - to be expected )
I'd say you where in the clear - I did a bit of following the white rabbit down the hole : and on each occasion came up where I expected to be.. I'ts a right cheek considering my C++ (then) C# has (/had) almost 20 years of rust on it !
Comments
Are you using the Sound: Play Action in your scene's OnStart Cutscene to play the sound, or just relying on the AudioSource's Play on awake checkbox? Try this if you weren't before.
Unity Ver. 5.3.6 / AC Ver. 1.52a & I can confirm that this is still happening:
My Player has a ‘walk’ sound clip applied exactly as in the tutorials
My Player is FP with no mesh attached but has animation, camera and a capsule collider (and the relevant sound child) – this all works fine (Normal interactions including “Look at” and AC functionality)
I also have a triggered SFX sound later on (Based exactly on the “Camera switch” example in the 3d video tutorial.)
Symptoms:
Run in editor – No sounds from either the players walk loop or the triggered sounds until the game is awoken from a pause. (Either (Esc) menu or Action list / Cutscene end)
“Sometimes” Sound will work OK on the first Editor Play-through… (it is NOT always : it depends on how much you have done in the editor and if you have /have not saved your scene (Works prior to a save)
Running in full build (standalone Win/Mac/Linux) is fine – with or without a scene prior to the scene with the audio in it. (Which is consoling – and proved that I was not going entirely do-ladley…)
In the editor the scene “sound” button is enabled – but becomes greyed out during test play , and the mute button is “unchecked” (sound on) during the whole test.
When the sound component on the player is visible during test – the Audio clip “walk” shows in the inspector as it should…. (but no sound)
I have no “on start” cutscenes – because I have a full introductory scene prior to the ‘Main event’ – although for my own sanity I would be happy to have one just to fire up the audio : but I don’t know how to build that yet and have not got the time ATM…
My Main Camera Audio listener remains on during the entire test.
What is interesting is that the “Play on awake” on the “Player’s” Audio source becomes Unchecked as soon as the scene is started – Regardless of editor settings OR having it saved to the prefab (So having it checked or not seems to make no difference!)
So it would seem this is a Unity Editor problem & I am reporting (as such) to bring this thread to "semi answered" conclusion : Unless anybody has found a cure – for which I personally would be grateful – If just to make development easier & to avoid catching any more red herrings & wasting loads of debugging time…
I am not using UFPS - Its AC Vanilla ( 'ish ) - no model : only the collider , if by Vanilla you mean the AC 'player' attached components - yes it is :-)
All three commented out (then, one by one & two by two in case of conflicts)
and no change - which is 'good' - no sound at the start on any combination...
StateHandler- lost sound completely (no sound on a resume because it was not re-set by the
HasGameStateChanged () due to the commenting out - to be expected
)
I'd say you where in the clear - I did a bit of following the white rabbit down the hole : and on each occasion came up where I expected to be.. I'ts a right cheek considering my C++ (then) C# has (/had) almost 20 years of rust on it !