Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: dshad44 on August 16, 2017, 04:01:39 PM

Title: Audio for playmaker
Post by: dshad44 on August 16, 2017, 04:01:39 PM
Hey guys and gals.

I see that audio source allows me to add sound effects and music to the game in unity, but can I use Playmaker to trigger the sound effects? Is it as simple as setting up FSM's on a "Sound Manager" and have it play the sounds when the user clicks on objects in the scene, etc?

I cant find any tutorials on sound for Playmaker, they all seem to be scripting oriented.

Thanks in advance!
Title: Re: Audio for playmaker
Post by: nFighter on August 16, 2017, 06:50:51 PM
Sure, playing sound is very easy. Simple "play sound" action can play defined file at defined point. I set position equal to my camera to be sure it will be loud enough to hear it. And don't hesitate to check the actions in the audio group, there is a lot of them.
(https://snag.gy/HNLTZe.jpg)
Title: Re: Audio for playmaker
Post by: dshad44 on August 16, 2017, 08:32:44 PM
Great! Thanks so much! I'll take a look at those.
Title: Re: Audio for playmaker
Post by: dshad44 on August 16, 2017, 09:40:48 PM
Well, the issue that I get when I use Play Sound is that it sounds very quiet, and I don't have much control over the volume, or anything else.

I don't see many options for playing sounds in the audio actions either. Is there a way to send event from one 'clicked' object to a sound master that will then play the audio? Is that how people deal with sound effects for user interactions?

Thanks again!
Title: Re: Audio for playmaker
Post by: tcmeric on August 16, 2017, 11:43:26 PM
Try "Audio Play" instead of "play sound". If you use audio play, you can add a sound source component to the game object. Then you can control everything by this audio component (3d/2d, volume and which mixer to use).

Play sound is good for a simple setup that doesnt need many changes, but if you need a mixer or any changes, then audio play is recommended.
Title: Re: Audio for playmaker
Post by: dshad44 on August 17, 2017, 09:05:07 PM
Great! Thanks so much! Using audio play has fixed my issue!

Now my question is, "play random sound" seems to only work similarly to "play sound".

Is there a way to integrate playing random sound clips with the audio play option? It seems that I have to specify a clip I want to play, but there is no randomizing it.
Title: Re: Audio for playmaker
Post by: tcmeric on August 17, 2017, 11:03:02 PM
Yes. I wrote a custom action for that (based on someone elses custom action). I just wrote it this last week for myself :)

It will select a random audio clip (works like audio play), and then it plays the clip. Give it a try.
Title: Re: Audio for playmaker
Post by: djaydino on August 18, 2017, 12:55:45 AM
Hi,
if your are planning a "sound Manager" you should look to this tutorial about global events/Transitions :

Title: Re: Audio for playmaker
Post by: dshad44 on August 18, 2017, 07:52:25 PM
Great! I'll take a look at both! Thanks so much!