Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Zswag on March 25, 2019, 10:36:46 AM

Title: Play Random Sound through Audiomixer
Post by: Zswag on March 25, 2019, 10:36:46 AM
Hello.

I have a quick question that I been googling around for an answer without success. I have all my background music run through a audiomixer that works perfectly.

Now I would like all my sound effects to do the same. I have a character that swings a sword. Right now I use the action "Play Random Sound" to randomize between 3 different swing sound effects. I can't found anywhere to choose that they would be played through a audio mixer.

Is there a way to "play sound through audio mixer" or something like that?

(Or maybe I have misunderstood the whole thing of how audio mixers work)

Thanks a bunch!
Title: Re: Play Random Sound through Audiomixer
Post by: djaydino on March 26, 2019, 03:54:32 AM
Hi.
Audio mixer are like channels.

there are some random audio actions on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)

But what i usually do is :
Have an array with the audio sounds, then use Array Get Random (optional set 'No Repeat' so that same sound can not play 2x in a row)

Or i use 'Random Weighted Int' (on Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))
and then 'Array Get' and use the result of the int as index.
this way you can control if some sound shoul be played more often than the other.

Then i use 'Audio Play' with the result as One Shot Clip variable.