Physics Constraint Component User Guide

A user guide on using the Physics Constraint Component in Blueprints.

On this page

Overview

Physics Constraint Components operate just like Physics Constraints Actors, except they are used in Blueprints or can be created in C++. Given the flexibility of Blueprints and the power of C++, you can constrain just about any Physics Body in your project using Physics Constraint Components.

This document will cover Physics Constraint Component basic creation in a Blueprint.

This document assumes that the user has some knowledge of Blueprints and the Blueprint Editor.

Usage

  1. Create the Components that will be used to constrain. For this demonstration, two StaticMesh Components referencing the StaticMesh Shape_Cube will be used.

    Two StaticMesh Components referencing the StaticMesh ShapeCube will be used

    You will need to position the Components that you want to be constrained. For this guide, these two cubes are used.

  2. Enable Simulate Physics for the lower of the two StaticMesh Components.

    Enable Simulate Physics

  3. Click Add Component to find Physics Constraint.

    Click Add Component to find Physics Constraint

  4. Position the Physics Constraint Component where you wish the joint of the constraint to be.

    Position the Physics Constraint Component

  5. You must manually type in the names of the StaticMesh Components you wish to constrain in the Details panel of the Physics Constraint Component. Type in the component name you wish to constrain in the Component Name 1 of the Component Name property.

    Type in the component name you wish to constrain in the Component Name 1

  6. Type in the component name you wish to constrain in the Component Name 2 of the Component Name property.

    Type in the component name you wish to constrain in the Component Name 2

  7. Select the Physics Constraint component and move its location to the bottom of the StableMesh component. This will place the anchor point at the bottom of the cube.

    Select the Physics Constraint component and move its location to the bottom of the StableMesh component

    Want to know what all the properties on a Physics Constraint Component affect? See the Physics Constraint Reference for specific details.

  8. Rotate the Physics Constraint Component as necessary to account for Linear and Angular Limits.

    Rotate the Physics Constraint Component

  9. Place the Blueprint Actor in a level and position it where you need it.

    Place the Blueprint Actor in a level and position it where you need it

  10. Select Blueprint Actor and go to the Details panel. Select the ConstrainedMesh component in the hierarchy and move it as seen in the picture. In this example, the location was set to X = -300 and Z = 100. This will allow the ConstrainedMesh to swing once you press Simulate.

    Select Blueprint Actor and go to the Details panel

  11. Test by using Simulate in Editor or Play in Editor.

    physics-constraint-blueprint-simulate