Lumberyard
Legacy Reference

Creating Mannequin Actions

You may want to create a new action class or simply use a generic one for simple cases.

With this constructor, you can do the following:

  • Set the relevant FragmentID, which is the first FragmentID that gets requested.

  • Set any FragmentID-specific tags (frag tags).

  • Set the action priority, which is used to manage overlapping actions and actions that want to own the same scope. Higher numbers indicate higher priority.

The following shows a sample code snippet that creates an action that plays the Idle FragmentID.

const FragmentID idleFragmentId = m_pAnimationContext->controllerDef.m_fragmentIDs.Find( "Idle" ); const int actionPriority = 0; IActionPtr pAction = new TAction< SAnimationContext >( actionPriority, idleFragmentId );