Constraint Instability and Replication Issues

Edit:
My second post escalated this thread to an issue pertaining to constraint instability and replication issues pertaining to constraints. My original problem is no longer relevant, but I will keep it here because although I found a way around it, I never resolved it.

Original problem with PrismaticConstraints I seem to be having trouble figuring out how to use PrismaticConstraints in one of my applications, which is to steer the wheel of a car. The PrismaticConstraint does not stabilize.

Here is a diagram of my constraint setup:

My intended behavior is the following, except towards the end it begins to lose stability and move erratically. I am incrementing the TargetPosition property by 0.1 to try and show what is intended, but in practice, I should be able to directly make the property equal to 0.3, 1, etc.

https://i.gyazo.com/6d7824ea8555a2f99ecfe46a6434861e.mp4

The issue can be seen most clearly here:

https://i.gyazo.com/109043a587ea9a1dc8fad6c823aab024.mp4

And these are the properties of the PrismaticConstraint:

Additionally, when the PrismaticConstraint does appear to stabilize, and it is selected, the selection box itself doesn’t appear to sit still either.

https://i.gyazo.com/9ca8b5cb5471573963ae7bdbae04d0c9.mp4


I previously made a rig which used the same concept of BallSocketConstraints, HingeConstraints, and a PrismaticConstraint to steer with, which had the same issue as this, but I ended up restarting due to not being able to find a solution.

https://i.gyazo.com/b8f1226ab35810bff9e32e0a8c8b5658.mp4


I have tried setting Limits to the PrismaticConstraint as well as adjusting the lengths of the red part to be the precise length it should. As for the BallSocketConstraints, the UpperLimit is set to 45, the restitution is 0, and TwistLimitsEnabled is false.

I’m sure I’m doing something wrong somewhere, but I can’t figure out where.

2 Likes

I’m trying to make a steering mechanism for my vehicles using a Motor6D. I would use a HingeConstraint, but those are not capable of remaining straight without wobbling left to right while driving.

I decided against using PrismaticConstraints, in favor of a Motor6D, which has solved my initial problem of not being able to steer. However, an entirely new and more glaring issue has arose, and again, I have no idea why.

https://i.gyazo.com/41e2227071b4ed617ce945349f3692e4.mp4

On my screen, my vehicle functions perfectly fine. When I look at other people in their vehicle, it … well, look in the video above. There are no scripts other than one server script to set the AngularVelocity of HingeConstraints (the motors) and to set the DesiredAngle of the Motor6Ds (steering).

Additionally, when my car touches or comes in contact with the other person’s car, both cars instantly disappear, and both players die instantly as well. It seems like a physics problem, but what confuses me is that there are no local issues with the vehicles, like an indication of constraints being used improperly.

If you look closely in this gif, the front two wheels appear to be moving in relation to the back wheels spinning, as if the front wheels are attached to the rear, but they aren’t. My vehicle as well as other instances in workspace begin to flicker randomly as well.

https://i.gyazo.com/f44e75d0a05bc2634ba2fe79c4636ae0.mp4

Is there anyone from the physics engine team that can help me figure this out? I don’t understand what is going on.

1 Like

I’ve tried to include more visuals of the problem to show it more clearly, as well as a download link to a simplified model of the chassis.

Chassis.rbxm (41.3 KB)

In the video below, you can see as my character enters the replication zone for the car, it acts normally, but as soon as I exit that zone, it goes back to replicating wrongly.

https://i.gyazo.com/1376782f37f2eab036a052204025f9cd.mp4


This can be seen as well when switching between the Client view and the Server view in Studio. The client sees a functioning car, whereas the server (and everyone else) sees it as very glitchy.

https://i.gyazo.com/c956a40af4a4e84c3df334fbcccde00d.mp4


And in a real server, this is what other players see.

https://i.gyazo.com/ff3af1448f4eaf1141567ea4c5bb41f4.mp4

1 Like

Motor6Ds are not supported by physics, and should not be used for anything but animations, really.

Combining Motor6Ds + setting Wheel Root Priority to 10 causes this issue. This causes one of the wheels to become the root of the mechanism, which means the rest of the car is interpolated with respect to this wheel. Because Motor6Ds are not supported by Interpolation, the relative rotation between the Root Wheel and the Chassis is in a weird “Old” state that causes your car to look like this.

If you revert the Root Priority of the Wheel to 0, this will most likely fix any issues you have. However, your wheels will interpolate choppily, due to the Motor6Ds being involved.

6 Likes