Forum rules - please read before posting.

SFX playing on scene load

Hi, hoping for a little help please.

I've created a sound effect which I want to use as a Play one-shot, which does work within the interaction as required, however, when I play the scene from the start, the sound effect plays immediately and I can't see how to switch it off. I only want it to play once within the designated interaction action list.

I've deleted it and then re-imported it within my own folder called SFX, there's no Sound Prefab. I've tried it with a Sound Prefab and no difference.  Am I missing something obvious? I've read the manual and it appears the Play one-shot should work in this context.

I'm using version 2017.2.Of3 of Unity and AC 1.60.5

Many thanks

Comments

  • **Update**

    Ok, so I tried another clip with another interaction and it works perfectly. I'm now wondering if an earlier version of the original SFX is still playing after I deleted it? I did import a few trial versions. Perhaps it's still present as a Prefab but not visible within the project folders, is that possible? Is there a way to get rid of it?
  • Actually that can't be it as when I delete the audio file it doesn't play when the scene starts. Totally stumped.
  • Strange.  Indeed, the Sound: Play one-shot Action doesn't rely on a Sound object or even an AudioSource.

    There's only two ways that I can see this happening.  The first would be that there's an AudioSource in your scene that's set to play the sound on start - this may or may not be with a Sound attached as well.

    If you select it in the Scene Manager, you'll get a list of existing Sound prefabs in your scene.  If you disable all those that show, does it still occur?

    Perhaps the AC Sound prefab has been updated - you could try re-importing that from the Asset Store.  The file itself is /Assets/AdventureCreator/Prefabs/Logic/Sound.prefab.

    The other way that this would run is if the Interaction itself is being called when the scene begins.  Though doubtful, you could try inserting an ActionList: Comment to the list of Actions (with "Print to Console?" checked) to confirm that this isn't the case.

    If you've deleted the audio file, try importing it under another name - if there was a reference to it previously, that may cause it to remain broken upon reimporting.
  • Chris, you are a star!

    I did have a couple of rogue AudioSources in the scene. Deleting them didn't make any difference at that point but I changed the name of the SFX and attached it to the Play one-shot and bingo, all working as expected again.

    Thank you once again for your help. A very silly error on my part, and one I won't make again. The Play one-shot is a valuable and quick to use function.

    I'm sure I'll be back  but thank you once again for your help :D
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.