playMaker

Author Topic: [SOLVED] Set Audio Source Output (and other Audio Source properties)?  (Read 807 times)

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Hi there!

I'm creating several game objects and adding Audio Sources to them at run time and need to set up a few parameters like "Set Audio Clip" and "Set Audio Loop" at the same time. Additionally, I need to set the Audio Mixer Group and bypass the various effects in some cases but I haven't found any actions which set these properties.

For some odd reason, the Store Component field on my "Add Component" action won't allow me to input an object variable - it just shows "None" in the drop down with no option to create a variable. I imagine I could use this object variable in the Set Property action to the define audio source properties but after trying with a different object variable, I was only able to set the object's name.



Since there are already a few "SetAudio___" actions, I was trying to modify them to change the other parameters but I haven't had any luck with that yet.

I would really appreciate it if someone could give me a hand with this or point me in the right direction on where I might be able to learn more about how this could be done.

Thanks :)
« Last Edit: February 08, 2021, 11:54:37 AM by acornbringer »

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Set Audio Source Output (and other Audio Source properties)?
« Reply #1 on: February 08, 2021, 11:31:24 AM »
will letting you save on the variable is going to help you to solve your problem?
if so,

Then,

1. Go to the variable tab
2. Create a variable with "object" type and give a name like Audio1 or something
3. then click the object Type and find the audio source under unityengine
4. then you can save on it

Good luck

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Re: Set Audio Source Output (and other Audio Source properties)?
« Reply #2 on: February 08, 2021, 11:54:15 AM »
Dang! I totally missed that. The Object Type was just set to Object and I never even thought to define it as an Audio Source in there. Setting it to Audio Source both lets me define the variable in the Add Component (Audio Source) action's "Store Component" field and search for more parameters in the Set Property action. Looks like I'm all set!

Thanks for that :)
« Last Edit: February 08, 2021, 11:56:00 AM by acornbringer »