Unexpected behavior when applying velocity on a part perpendicular to a rotated wall

Issue

When applying velocity on a part that’s perpendicular to a rotated wall, so the part moves straight onto the wall’s long surface, it will behave differently compared to the exact same case with a wall that’s not rotated. This works as expected as long as the wall’s orientation on the XZ plane equals to 0°, 90°, 180° or 270°.

Backstory

I was working on a custom character controller when this problem came up which I spent countless hours debugging until I came up with the very simplified reproduction file provided below.

Setup

The moving parts are duplicates and consist of the same properties and configurations.

Modified properties that’re worth looking into are

  • CustomPhysicalProperties
  • Wall parts’ Orientation
  • AlignOrientation’s CFrame, MaxTorque and Responsiveness
  • LinearVelocity’s VectorVelocity and MaxForce

The moving parts are essentially made up of an AlignOrientation object and LinearVelocity object as shown below.

It’s worth noting that both the moving parts’ Friction values are set to 0 and FrictionWeight values are set to 100 for a desired nearly friction-less behavior.

image

Demonstration

Recording from repro file

Repro

unexpected_physics_repro_file.rbxl (38.5 KB)

4 Likes

I believe something internally is causing AlignOrientation’s CFrame property to stay == CFrame.new(), although printing seems to indicate otherwise. Rollback indicates this issue was not occurring before the most recent update
EDIT: AlignOrientation doesn’t seem to work properly specifically in OneAttachment mode

If that’s true, just as a note to the engineers, this has to be related to BodyGyro as well as this was also the case with BodyVelocity & BodyGyro instead of LinearVelocity & AlignOrientation. I switched to the latter prior to this bug report to see if it’d make a difference, which it did not.

Just following up!

We’ve filled a ticket into our internal database for this issue, and will come back with an update as soon as we have news!

Thank you for the report!

2 Likes

This issue has been fixed by recent improvements to the way forces are limited for the LinearVelocity constraint. Unfortunately, the issue will remain for BodyVelocity due to the way forces are specified for that class.

Please report back if there still seem to be any issues with the LinearVelocity constraint. Thanks.

2 Likes

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