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
In the Animation Editor, on the right side of the menu bar, choose AnimGraph from the drop-down list. This changes the layout.
In the Anim Graph pane, click the + icon to create a new animation graph.
Right-click the grid and then choose Sources, Motion. Alternatively, in the Node Palette, on the Sources section, drag Motion into the animation graph.
Select the Motion node in the animation graph.
In the Inspector pane, do the following:
For Name, enter a name for your motion. For example, Run.
Click the + icon under Select motions. In the Motion Selection window, select a motion and then click OK.
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.
Select the Blend Tree node in the animation graph.
In the Inspector pane, enter a name for your blend tree. For example, Ragdoll.
In the animation graph, connect the Motion node to the Blend Tree node. For example, connect the Run node to the Ragdoll node.
Double-click the Blend Tree node.
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.
Connect the Output Pose for the Activate Ragdoll Joints node to the Input Pose for the Final Node node.
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.
In the Inspector pane, click Add condition and then choose Time Condition.
Under Time Condition, set the Countdown Time.
In the animation graph, click the Motion node for a preview.