Create a new scene and follow these steps:
- Create an agent group and set its display type to skin.
- Add a grid layout module.
- Create a plane, scale it by 500 on all axis and add it as an height field with the height field manager .
- Duplicate the plane and set the duplicated plane Y value to -1
- With the duplicated plane selected, click on the shelf button for creating a rigid body (AtomsPhysx shelf)
- Set the rigid body mesh type to plane
- Select the agent group again.
- Add a state machine module.
- Set the height field of the state machine to the height field you just created.
- Select the tcAtomsSolver (you will find a tab in the attribute editor when having any agent group selected), enable Physx , set the scale to 100 and the sub samples to 15.
- Add a ragdoll module to the agent group.
- Set the mode of the ragdoll module to "3 - ragdoll" and press play.
- You will see your agent falling on the floor.
Let's keep working on this scene:
- Set the State Machine module state to 1.
- Change the ragdoll module mode value to "2 - kinematic"
- Set a key frame on the mode field at frame 1, by right clicking on the drop down menu and clicking "set key".
- Set another frame at frame 10, then move to frame 11 and set a keyframe with value "3-ragdoll".
- Press play.
- You will see the agent walking for 10 frames and then falling down.
- Rewind the animation.
- Right click again on the mode field of the ragdoll module and click on "Break connections" (the mode should be set to 2-kinematic)
- Create a plane, scale it by 200 and move it <150, 70, 0>.
- Select the atoms group and add an area trigger module.
- Set the plane as mesh for the area trigger module, then set the metadata name to "dynamicMode" and the field "Int Value" to 3.
- Select the ragdoll module and turn on the "useDynamicModeMetadata" option.
- Press play.
- You will see the agent walking and then falling down as soon as it enters the areaTrigger plane.
Please feel free to expirement a bit more, by playing with the ragdoll module options and by adding more agents to your simulation.
Widget Connector | ||||||
---|---|---|---|---|---|---|
|