Forum rules - please read before posting.

Sounds when examine inventory objects

Hi all,
maybe this is a Unity related question, but maybe AC could come in handy...

I would like to play a sound when combining or examine different object I have in the inventory. For example when I examine a whistle, I play the sound of a whistle.

For a single scene isn't a problem, I attach the sound obj under the main camera and it plays.
But if I have 20 or 30 scenes, I cannot attach everytime all my sounds obj to the maincam...

So, there's a way to do this by using the sound library in the folder sounds? 

Tx all!
Bye

Comments

  • You can do it with just one Sound object - add one in your scene, and give it a Constant ID number.  Then check "retain in prefab" and make a new prefab out of it.  Make sure it is in all of your scenes.

    Then, reference this prefab when your ActionList uses a Sound: Play Action.  That will then cause it to look for your local Sound object in your scene, and play from it.
  • You mean like for the background music? I had think this solution, but it's not very "light". If I have 30 sfx for 30 inventory obj and 30 scenes... 
    I know it's a Unity limitation and not AC, but maybe AC can get rid of this.
  • Agreed I have over 50 scenes. I wouldn't be able to sleep if I had to copy/paste 20-30 SFX in all scenes. Not to mention if I had to edit , add or remove one.
  • You can just parent it to a prefab that you know will be in your scene, e.g. the Player.  The Action will basically look for any Sound object that has a matching Constant ID number - it doesn't care where in the scene hierarchy it actually is.
  • Yeah! That's a simple and effective solution!  :-bd
    Namasté @ChrisIceBox
    :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.