Ways to rotate/move parts on the client side to prevent the lag caused when it is done on server side

I made a simple Obby game, pretty much my first playable game, and it contains multiple stages, one of them containing rotating kill parts. It is made by connecting the rotating part to a smaller part below it with a HingeContraint. A con of this is that there is some lag during the rotation, and it’s not as smooth. What I need help with is how to make the rotation happen on the client side and not the server side, or if there’s a better way to do it.

I already tried making a local script inside of the part that unanchors it and enables the hinge, but that didn’t work.

1 Like

Cna you show me the code you already have (if any)? I think I can help you, but I just want to see your code.

I don’t have any code, if you’re talking about the local script that didn’t work then here it is:

script.Parent.Anchored = false
script.Parent.HingeConstraint.Enabled = true

I have solved my own problem.

I added tags to each rotating part, and from a local script (inside of StarterPlayerScripts) I made a while true loop that rotates the part using TweenService. This way the rotation happens on the client, and not the server.

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