How-To Apply a Physics Constraint Profile
Below you will find the steps for creating a simple graph to enable a Physical Animation Profile on a Skeletal Mesh Component in a Pawn.
Open or create a Blueprint with a Skeletal Mesh Component.
Or, if your Blueprint doesn't contain a Skeletal Mesh Component, add one using the Components Panel.
Adjust the Skeletal Mesh Component Collision settings.
The Collision Preset needs to be changed so that that Skeletal Mesh Component has Collision Enabled but also so it doesn't interact with Pawns:
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: Add a Custom Object Type to Your Project, for more information on creating Custom Collision Channels.
Add a Physical Animation Component to your Blueprint using the Components Panel.
Add a Name Variable and call it Bone Name.
Compile so we can set the value of the Bone Name variable.
Change Bone Name Default Value to the desired target Bone, in this case spine_01.
Switch to the Event Graph.
Locate or create the Event BeginPlay event node.
Add a Set Skeletal Mesh Component Node connecting to Event Beging Play
Target is the Physical Animation Component you added above.
In Skeletal Mesh Component is the Skeletal Mesh Component in your Blueprint or the one you added above.
Add a Apply Physcial Animation Profile Below Node connecting to the Set Skeletal Mesh Component Node.
Target is the Physical Animation Component.
Body Name will accept the Bone Name variable as input. In Physics Assets, Physics Bodies are named after their Bone.
Profile Name the name of the Physical Animation Profile you wish to apply to the Skeletal Mesh.
Since we are using `spine_01' as the desired bone so that just the upper body animates, Include Self should be checked.
Clear Not Found is optional, but we've set it to True to clear any bones that are not found in the profile.
Set All Bodies Below Simulate Physics Node connected to the Apply Physcial Animation Profile Below Node. This will complete our graph.
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.
Hidden Graph Information
The name of the Bone in the Skeletal Mesh to start applying the Physical Animation Profile. We also use it in the Set All Bodies Below Simulate Physics.
Physical Animation Component
This is the component that actually handles the Physical Animation of our Skeletal Mesh.
Skeletal Mesh Component
The Skeletal Mesh Component that will be physically animated. If working from an existing Blueprint that inherits from Character, it will simply be named Mesh.
When finished, your Skeletal Mesh Component will be simulating physics using the Physical Animation Component while in runtime.