Generic

The Generic ability is an extremely versatile ability that allows you to add any animation without scripting a new ability. The ability will end after a specified duration or the OnAnimatorGenericAbilityComplete event is sent.

Setup

  1. Decide on the animations that you want to use. For this example we are going to import the Adventure – Sample Game asset and use the PutGlassesOn animation.
  2. Add the animation to the Animator Controller. Create a new substate within the Full Body Layer called Generic and then create a new state that uses the PlayerPutGlassesOn motion.
  3. Setup the transitions to your new state. By default the Generic ability uses an AbilityIndex of 10000 so it doesn’t get in the way of other abilities. For this example we are going to use an AbilityIndex value of 10100.
  4. Select the + button in the ability list under the “Abilities” foldout of the Ultimate Character Locomotion component.
  5. Add the Generic ability.
  6. Set the AbilityIndex value to the same value that was set for the transition. This value should be set to 10100 in this example.
  7. Decide if the ability should end based upon an animation event or a timer. An animation event is more accurate so we will use this method.
  8. Decide when the ability should play. By default the ability will start when the action button is pressed.

Inspected Fields

Stop Event

Specifies if the ability should stop when the OnAnimatorGenericAbilityComplete event is received or wait the specified amount of time before ending the ability.