This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

Adding a Ragdoll to an Animation Graph

When you create an animation graph to control the ragdoll simulation of your character, you do the following:

  • Prepare the actor asset.
  • Adjust the animation graph to enable the ragdoll.
  • Preview.

The animation graph controls the ragdoll simulation of your character. When your character transitions into a blend tree that has a ragdoll node, the ragdoll automatically activates and simulates in game mode in O3DE Editor. When your character transitions out of that state, the ragdoll deactivates. The ragdoll node outputs a bind pose in the Animation Editor.

To create an animation graph to transition from running state to ragdoll state

  1. In the Animation Editor, on the right side of the menu bar, choose AnimGraph from the drop-down list. This changes the layout.

    Change the Animation Editor layout by choosing AnimGraph from the drop-down list

  2. In the Anim Graph pane, click the + icon to create a new animation graph.

  3. Right-click the grid and then choose Sources, Motion. Alternatively, in the Node Palette, on the Sources section, drag Motion into the animation graph.

    Add a Motion node to the animation graph from the context menu or the Node Palette in the Animation Editor

  4. Select the Motion node in the animation graph.

  5. In the Inspector pane, do the following:

    1. For Name, enter a name for your motion. For example, Run.

    2. Click the + icon under Select motions. In the Motion Selection window, select a motion and then click OK.

  6. Right-click the grid and then choose Sources, Blend Tree. Alternatively, in the Node Palette, on the Sources section, drag Blend Tree into the animation graph.

    Add a Blend Tree node to the animation graph from the context menu or the Node Palette in the Animation Editor

  7. Select the Blend Tree node in the animation graph.

  8. In the Inspector pane, enter a name for your blend tree. For example, Ragdoll.

  9. In the animation graph, connect the Motion node to the Blend Tree node. For example, connect the Run node to the Ragdoll node.

    Connect the Motion node to the Blend Tree node in the animation graph in the Animation Editor

  10. Double-click the Blend Tree node.

  11. Right-click the grid and then choose Physics, Activate Ragdoll Joints. Alternatively, in the Node Palette, on the Physics section, drag Activate Ragdoll Joints into the animation graph.

  12. Connect the Output Pose for the Activate Ragdoll Joints node to the Input Pose for the Final Node node.

    Connect Activate Ragdoll Joints node to Final Node in the animation graph

  13. At the root of the animation graph, select the transition line that starts from the Motion node and connects to the Blend Tree node. For example, select the transition line that connects the Run node to the Ragdoll node.

    Select the transition line that connects the Motion node to the Blend Tree node in the Animation Editor

  14. In the Inspector pane, click Add condition and then choose Time Condition.

    Add a Time Condition from the Attributes pane in the Animation Editor

  15. Under Time Condition, set the Countdown Time.

  16. In the animation graph, click the Motion node for a preview.