Disabling PrismaticConstraint - client server discrepancies

Hello!

I am using PrismaticConstraints for an elevator system. When I anchor the part with the constraint, it stops as expected. However, the client and server both stop the part in different positions, causing the client to try and move the player to the position the part is on the server giving this undesired effect:

Disabling the constraint has no effect on this, and even deleting it entirely doesn’t solve the issue. I assume this might be something to do with network ownership. How can I ensure that, when the constraint is disabled / part anchored, it is in the same location on both the client and server?

Anchoring a part will automatically set the physics simulation to server side. What’s happening here is that the part is conserving its velocity and the character moves up (anchored part with velocities act like conveyors, even up). You need to set the part’s Velocity to 0,0,0 after anchoring it to prevent this.

Not entirely sure if disabling the PrismaticConstraint produces the exact same phenomenon.

1 Like

Ah okay. Setting the velocity to zero does indeed fix the character movement issue, but the part is still in a different position on the client than the server.
And I am doing this from a script where I do disable the constraint itself too. Whether I disable it before or after anchoring doesn’t seem to make a difference

The height difference seems negligble in my opinion (it’s only 0.2 studs on my side), but you can try doing

ROOT:SetNetworkOwner()

right before the game starts/you initially enable the constraint/right after you unanchor it for the first time. This ensures the simulation runs on the server only.

For me I get around 2.4 studs out. Unfortunately I experience further issues with setting the network owner to be the server, similar to this thread Physics Based Elevators Sleeping Parts Issue