Using Kinematic Bodies with Simulated Parents

Choose your OS:

The Physics Asset Editor provides several different ways in which you can simulate physics bodies including the ability to have kinematic physics bodies with simulated parents. This enables you to define child bodies that can be driven by animation data while the parents of those bodies are driven by physics simulation data. This can be useful if you have a character that you want to perform a physics based reaction while playing a hanging idle or hanging traversal animation.

In this How-to, we use kinematic bodies with simulated parents to generate the effect of a character hanging from a ledge while the rest of the body is simulated with physics.

EndResultImage.png

Steps

For this guide, we are using the Blueprint Third Person Template project with Starter Content enabled.

  1. In your project in the Content/Mannequin/Character/Mesh folder, open the SK_Mannequin_PhysicsAsset.

    KinematicHowTo_01.png

  2. In the Hierarchy window, click the All Bones drop-down and change it to Bones With Bodies.

    KinematicHowTo_02.png

    This will filter the hierarchy to only show bones with bodies and make it easier to select the bones you want to manipulate.

  3. In the hierarchy list, hold Ctrl and select both the hand_l and hand_r bones, then in the Details panel, change the Physics Type to Kinematic.

    KinematicHowTo_03.png

    By setting these bones to Kinematic, they will not simulate physics and will follow any animation data.

    Alternatively, you can right-click bones in the hierarchy list and set their Physics Type from the roll-out menu.

    KinematicHowTo_04.png

    This option enables you to set the Physics Type property for children bodies below the current bone.

  4. Click on an empty space within the viewport to deselect all bones, then in the Details panel, change the Physics Update Mode to Component Transform is Kinematic.

    KinematicHowTo_05.png

    This option determines whether the simulation of the root body updates component transform or is kinematic.

  5. From the toolbar, click the Simulate button.

    KinematicHowTo_06.png

    The character in the viewport will slump over and appear to be hanging by their hands.

    KinematicHowTo_07.png

  6. From the toolbar, click the Animation selection icon, then select the ThirdPersonJump_Loop animation.

    KinematicHowTo_08.png

    The hands (because they are set to kinematic) will follow the animation data contained within the ThirdPersonJump_Loop motion.

    KinematicHowTo_09.png

  7. From the Main Editor window, drag the SK_Mannequin_PhysicsAsset into the level and in the Details panel, set Physics Transform Update Mode to Component Transform is Kinematic.

    KinematicHowTo_10.png

  8. Select the SkeletalMeshComponent, then change Animation Mode to Use Animation Asset and Anim to Play to ThirdPersonJump_Loop.

    KinematicHowTo_11.png

  9. Click the Play button from the toolbar to play in the editor.

End Result

Below we've placed the character near a ledge when we run and bump into it, it reacts to physics while the hands appear slightly fixed.

While the animation we used above not ideal, below we apply the same concept to an animation of a character hanging and traversing a ledge.

The arms and head are set to Kinematic (denoted below with Gold Boxes) while the rest is being simulated.

ExampleSetup.png