For the complete documentation index, see llms.txt. This page is also available as Markdown.

Animation States

Summary

Control animation states from a Reactor server using entity properties as animation parameters linked to animation transitions in an animation controller.

Setup

  1. Import 4 animations. 'Idle', 'Walk', 'Run', and 'Cheering' and configure the following properties on all animations

Loop Time = Checked
Root Tranform Rotation
  Based Into Pose = Checked
  Based Upon = Body Orientation
  
Root Tranform Position Y
  Based Into Pose = Checked
  Based Upon (at Start) = Original
  
Root Tranform Position XZ
  Based Into Pose = Checked
  Based Upon (at Start) = Original
  1. Create an animation controller and add the imported animations. Add a float parameter named Speed and a bool parameter named Cheering to the animation controller. Add transitions between the animation states with conditions based on the two parameters:

  1. Create an NPC game object from the idle animation asset. Set the NPC animator controller reference to the animation controller created above.

  2. Add a Reactor ksEntityComponent to the NPC and uncheck the 'Is Permanent' property.

  3. Add a ksAnimationSync to the NPC. Expand the 'Animation Properties' section and make note of the properties. The number before the property is the id we will use to set the property value on the server. The 'Speed' property should have id 1000 and 'Cheering' should have id 1001.

  • You can change their ids by changing the starting value for 'Animation Property Ids'. If you change their ids, be sure to change the ids in the script you create for the next step.

  1. Add a Reator server entity script named seAnimator to the NPC. This script sets the entity property 1000 ('Speed') value and the entity property 1001 ('Cheering') property during an update loop. The script changes the speed during the update loop and periodically sets and unsets the cheering property. This is just an example script, actual scripts used in games will drive animation states in different ways.

seAnimator.cs

Last updated