Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: sebaslive on March 20, 2015, 01:44:56 PM

Title: Set Random Audio Clip
Post by: sebaslive on March 20, 2015, 01:44:56 PM
So, in the latest release of Unity 5 you can see that all the audio has been changed from automatically being 3D to 2D which makes all One shot audios pointless in a 3D game (if you know how to change the settings, let me know!) There is an action for Play Random sound. How about a Set Random Audio Clip? Just add it in and use the audio play action to play the sound.
Title: Re: Set Random Audio Clip
Post by: terrorOfNewDelhi on March 25, 2015, 02:53:48 AM
Useful, thanks.
Some guys modified the PlayRandomSound action to include the spatial setting. This could also be a useful alternative.
http://hutonggames.com/playmakerforum/index.php?topic=9812.msg46624#msg46624

I'm also considering making a custom action that allows you to create a new AudioSource component, assign audio settings, and store that in a variable. You could use this to create multiple AudioSources on a single gameobject at Awake, then refer to them easily within the FSM to Play or adjust settings such as pitch.
Will be my first time creating a custom action though, so might take me some fiddling...
Title: Re: Set Random Audio Clip
Post by: sebaslive on March 25, 2015, 07:38:25 AM
Excellent, thanks for this and good luck with the action. I am still trying to get the hang of it.