How-To Apply a Physics Constraint Profile

This how-to will show you how to apply a Physics Constraint Profile to a Skeletal Mesh Component using Blueprints.

Windows
MacOS
Linux
Prerequisite Topics

This page assumes you have prior knowledge of the following topics. Please read them before proceeding.

Below, you will find the steps for creating a simple graph to enable a Constraint Profile on a Skeletal Mesh Component in a Pawn.

Steps

1. Open or create a Blueprint with a Skeletal Mesh Component.

* If your Blueprint doesn't contain a **Skeletal Mesh Component**, add one using the **Components Panel**.

![](addSkelMeshComp.png)
  1. Adjust the Skeletal Mesh Component Collision settings. * The Collision Preset needs to be changed so that that **Skeletal Mesh Component** has **Collision Enabled**, and if a **Pawn** capsule (or other geometry) exists make sure that the collision settings are compatible. For example with a **Pawn** capsule make sure to ignore the **Pawn** collision:

    ![](Engine\Physics\PhysicsAssetEditor\HowTo\ApplyPhysicalAnimationProfile\collisionSettings.png)
    
    [REGION:note]
    You'll notice that the **Object Type** is set to **Pawn** and that we're ignoring **Pawns** in our collision channels. This fixes the issue of the **Skeletal Mesh** trying to eject itself from 
    the collision capsule. However, if you want the **Skeletal Mesh** to collide with other **Pawns** you'll need to adjust what **Object Type** your **Skeletal Mesh** is and then change 
    how the **Capsule** interacts with that **Object Type**. See: **[](Engine/Physics/Collision/HowTo/AddCustomCollisionType)**, for more information on creating **Custom Collision Channels**.
    [/REGION]
  2. Add a Physical Animation Component to your Blueprint using the Components Panel.

    addPhysAnimComp.png

  3. Add a Name Variable and call it Bone Name.

    variableName.png

  4. Compile so we can set the value of the Bone Name variable.

    compile.png

  5. Change Bone Name's Default Value to the desired target Bone, in this case spine_01.

    boneName.png

  6. Switch to the Event Graph.

  7. Locate or create the Event BeginPlay event node.

    eventBP.png

  8. Add a reference to your Skeletal Mesh Component

    addSKMPref.png

  9. Pull off the blue pin on your Skeletal Mesh Component and search for Set Constraint.

    createSetAll.png

  10. Add a Set Constraint Profile for All node. Target is your Skeletal Mesh Component. Profile Name is the name of the Constraint Profile that you created (or will create) in the Physics Asset Tool. * (optional) **Default if Not Found** if a bone doesn't exist in the Profile, it will keep its current settings.

    constraintProfNodeSettings.png

  11. Set All Bodies Below Simulate Physics Node connected to the Apply Physcial Animation Profile Below Node. Target is your Skeletal Mesh Component. In Bone Name will take the Bone Name variable as input. New Simulate should be set to True. Again, since we are using spine_01 as the target bone, Include Self should be checked.

  12. Final Graph:

    Copy Node Graph

    fullGraph.png

    Hidden Graph Information

    Variable

    Value

    Description

    Bone Name

    spine_01

    We use it in the Set All Bodies Below Simulate Physics to define what parts of the Skeletal Mesh are simulating.

    Component

    Description

    Skeletal Mesh Component

    The Skeletal Mesh Component that will be have the Constraint Profile applied to it. If you are inheriting from Character this will just be named Mesh.

Result

Now when you play your game, the Constraint Profile will take over. Depending on your settings, this could mean that your character falls apart, or has motors engaged to make their arms flail around.

result.png

This effect was achieved by setting the Linear Limits on the upper arm constraints to Free.

achievedBy.png

Additional Resources

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback