Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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!
-
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)
-
Great! Thanks so much! I'll take a look at those.
-
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!
-
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.
-
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.
-
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.
-
Hi,
if your are planning a "sound Manager" you should look to this tutorial about global events/Transitions :
-
Great! I'll take a look at both! Thanks so much!