Pin constraints

By now you know that there's two attachment types: static and dynamic. However if you statically attach an actor to a rigidbody, all fixed particles will just follow the rigidbody around without exerting any forces upon it. Which means, the actor will react to rigidbody movement but the rigidbody won't react at all to the actor.

Enter pin constraints. Pin constraints allow you to attach particles to a rigidbody, stablishing a two-way energy exchange channel: particle movements will affect the rigidbody, and rigidbody movements will affect the particle.

Unlike most other constraints, pin constraints aren't stored in a blueprint. They are automatically created and managed by dynamic particle attachments.

A good example is a wind-driven ship. The sails should follow the movement of the ship, but they also have to be able to propel the ship when the wind blows. So a good idea is to attach the sails to the ship using dynamic attachments.

Using dynamic attachments (pin constraints) to create a physically simulated sail.


Two particles pinned to a capsule.

Pin constraints and collisions

When pinning a particle very close to or inside a collider (so that they overlap), if you have collision constraints enabled you can encounter a situation in which both constraints fight each other. This results in jittering and/or an undesired offset in the pin position, because the collision and pin constraint cannot be met simultaneously. If the particle is pinned to a rigidbody, results will be even worse as this setup causes a force feedback loop with largely undefined behavior.

Rope pinned to a collider. The pin constraint (shown in cyan) tries to keep the particle inside the collider, but the collision constraint tries to keep it outside. Collisions have higher priority than pin constraints, so they "win". The red numbers in the collider/particles are their phase values.

The solution is to use phases to filter out collisions between the pinned particle and the collider. See the collisions page for more information on how to set up collision phases. By setting the particle phase value to the same as the collider's, no contacts will be generated between them and collisions will not interfere with the pin constraint.

By setting the first two particle's phase values to the same phase as the collider's, collisions are filtered out and the pin constraint can do its job uninterrupted.