Forum rules - please read before posting.

Sound doesn't work until I press ESC

Hello!

Bit of a weird one. Sound in my game doesn't work until I press ESC to bring up the menu then ESC again to get rid of it then sound works.

I'm using a custom controller with a custom camera that has a basic camera script attached.

Cheers. 

Comments

  • Try to rely on AC's MainCamera for your rendering.  You can still use a custom camera, but have AC attach the MainCamera to it like it does any other GameCamera via Actions / Scene Manager.  Attaching the "_Camera" component to it will enable AC's various UI fields to make use of it.
  • I am using ACs main camera for rendering. My actual "camera" is untagged and has an AC script on it (can't quite remember which) to move the MainCamera around with it. 

    I think I deleted the MainCamera while trying to get the custom controller to work with AC and had to recreate it so maybe I did that wrong? Is there a Prefab I can use to recreate it?  
  • I just checked my camera has the "camera" script on and my main camera has the "main camera" script. They seem to work fine except for the sound.
  • edited March 2017
    I just realised I didn't have my camera put into the default in my scene settings but when I do it tells me "main camera doesn't have a main camera component" when it does. Doesn't change the sound situation though. 
  • Have you removed the Audio Listener component from your custom camera?  Unity only allows for one in the scene, and the MainCamera should already have one.
  • There was an audio listener on there but it was unticked. I've removed it entirely and now it works! Thanks. 
  • Actually it still doesn't work until I press ESC unless I have "maximise on play" selected. So hopefully that means it will work when it's playing a build and just not in the editor. 
  • I don't know why I thought it was fixed because it's back to not working again even when maximised. 
  • What about in builds?

    Going back to your deleted MainCamera, bring back the "proper" one by dragging in the prefab from /AdventureCreator/Prefabs/Automatic.

    IIRC, the UFPS integration had a similar issue - which I fixed by running the following in the UltimateFPSIntegration script's Start() function:

    AudioListener.pause = false;

    Try adding that to your custom camera script.
  • Adding that line seems to have done it, cheers. 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.