Moving Motor6Ds clientside causes collisions to break, any workarounds?

Hello! I have a problem with Motor6Ds and collisions. I have made a gantry crane-style contraption that makes use of multiple Motor6Ds which are moved clientside to achieve motion on multiple axes. However, when this is done, the collisions of the parts begin to stop working properly axes. Essensially, one Motor6D moves the two large metal beams back and forth, whilst another moves the cart and is connected to the metal beams. It’s hard to explain with words, but I hope the video will make it a bit what I mean. When the second Motor6D is moved, moving the cart left or right, the collisions for the cart remain where they are on the serverside, whilst visually the cart moves as intended. The position properties etc. for the parts are also correct.

Notice that movement of the first Motor6D (up and down) doesn’t cause issues, but sideways movement does.

If anyone could help me find a workaround, it would be much appreciated!
Thanks.

2 Likes

Test in both client and server. See if the part movement is replicated on the server. The server may simply see the cart in the same location, causing replication issues.

1 Like

On the server, everything stays in the same location.

1 Like

You need to replicate the movement on the server then. maybe make the motor 6ds on the server? That would be the easiest solution.

1 Like

The hard(er) solution would be to use a remoteEvent and periodically (0.1s) send cframe info of the crane to the server, and a server script handler updates it. This might cause weird player interactions though

1 Like

I’d rather keep everything clientside as the game I’m making is singleplayer and doing anything with the server causes stuff to look inconsistent in terms of laginess imo, but that may be the only workaround. I’ll see if there’s anything else I can do

1 Like

Solved the issue - simply used weldConstraints and PrimaryPart.CFrame. Thanks for the help though anyway!

EDIT: The reason this behaviour was occuring was because I was modifying the wrong property!
C0 and C1 are used to create ‘permanent’ offsets from the parts the Motor6D is connected to, but the intended property for actually moving the parts is called ‘Transform’ - I completely missed this as it isn’t displayed in the property window. After correcting this, everything nicely fixed itself!

1 Like

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