Character movement interferes with AlignPosition convergence

Reproduction Steps

System Information:
Intel (R) Core™ i7-6700K CPU @ 4.00GHz, 32 GB, NVIDIA GeForce RTX 2080 SUPER

Reproduction Files:
alignposition_bug.rbxl (41.8 KB)

Expected Behavior

When an AlignPosition’s Attachment1 is an attachment inside the character, Attachment0’s movement should be completely independent from the character’s.

Actual Behavior

When an AlignPosition’s Attachment1 is inside the character’s HumanoidRootPart, the character’s movement interferes with Attachment0’s in unwanted ways. For example, turning or jumping around with shift lock causes Attachment0 to move faster than the constraint’s MaxVelocity should allow it to, and also causes it to move in the wrong direction entirely.


Workaround

A solution could be to use OneAttachment mode instead of TwoAttachment and update the constraint’s Position with a script, but this shouldn’t be necessary.

Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Constantly

3 Likes

Thanks for the report! We’ll follow up when we have an update for you.

2 Likes

I believe everything is operating as intended here. The Max velocity on the align position constraint refers to the maximum velocity that the two bodies will converge at, not the maximum velocity that either body will experience (see documentation here) The meaning becomes a bit more obvious once you know more about how the constraint works. The AlignPosition constraint computes a target relative velocity of the two bodies based on the current relative velocity, the relative positions and the responsiveness of the constraint. This target velocity will eventually bring the two attachments together. The Max velocity is the cap on this target velocity so it only kicks in once the bodies are starting to move toward one another. In a situation like this, you might try limiting the max force instead of the max velocity. This will act as an acceleration limit on the bodies and will result in the “pet” following the humanoid less aggressively.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.