Setting New Physical Properties on Stepped Causes Collision Instability (Even if the values are unchanged)

Changing the CustomPhysicalProperties property of a base part to a new PhysicalProperties object on every step causes unexpected jittering behaviour, even if each PhysicalProperties object is identical to the last. I desire to change the Friction property of parts each frame, as it would be the simplest and most reliable way to gain greater control over the behaviour of constraint-based cars and vehicles.

Expected behaviour (CustomPhysicalProperties is not changed)

Actual behaviour (CustomPhysicalProperties is set to a new but identical PhysicalProperties object on every step)

The actual values of the physical properties of the wheels are identical in both, but in the version where the properties are updated each frame the car will quickly begin to skip and jutter while driving and continue to do so for a time after stopping, effectively making it unusuable.

Repro file:
Repro.rbxl (35.1 KB)

3 Likes

Looks like you have the values out of order in the PhysicalProperties constructor. It doesn’t match the alphabetical order shown in the properties view. Your script is assigning an elasticity of 1 with a weight of 100, so you have very bouncy wheels.

We could change the order of the properties to match the order in the constructor. Would that help?

5 Likes

That was extremely foolish of me, I just assumed it was the same order as the properties window! Thank you for the help!

1 Like

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