Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

How to get State Groups in States properties of object with WAAPI

0 votes

Is it possible to get the State Groups under the States of a Switch Container object?

Do I need to create a StateGroup object with its children State objects under the parent SwitchContainer object?

asked Sep 20, 2019 in General Discussion by Michelle A. (220 points)

1 Answer

0 votes

To get the switch container assignments states or switches, use: ak.wwise.core.switchContainer.getAssignments

To create assignments:

  1. Create the StateGroup and States in your project (under States, in project explorer game sync tab)
  2. Use ak.wwise.core.switchContainer.addAssignment to create an assignment in your switch container
To retrieve or set which switch group or state group is being used on the Switch Container:
  1. To get, use ak.wwise.core.object.get with reference name SwitchGroupOrStateGroup and DefaultSwitchOrState
     "return": [ "@SwitchGroupOrStateGroup", "@DefaultSwitchOrState" ]
  2. To set, use ak.wwise.core.object.setReference, with SwitchGroupOrStateGroup or DefaultSwitchOrState
answered Sep 23, 2019 by Bernard R. (Audiokinetic) (30,100 points)
edited Sep 24, 2019 by Bernard R. (Audiokinetic)
I do use getAssignments, but that only seems to get the Assigned Objects in the Contents Editor.  I'm not sure why I'm not also getting the States/StateGroups.  Would they require different WAAPI calls?  Thanks!
Thanks for the precision, I updated the answer.
Thanks for the update.  I'm able to set those references under the General Settings tab, but I'm trying to add State Groups to an object in the States tab.  Is it possible to do that with WAAPI?  When I use get/setAssignments, am I only able to assign objects for whatever switch/state is set in General Settings?  When I set the reference to a Switch, it gets and sets the switches under Assigned Objects.  Do I need to set the Group to a State before I can get/set State Groups?  Thanks!
Sorry, I misunderstood your question. No, it is not possible to set or get the State values in the States tab. I noted your request.