How to prevent "lagging"/jittering when moving object

Hey guys, thanks for reading my post.

So I am currently in the midst of making an elevator-type thing for my group game. And I am currently using TweenService to change the position of the part. But, I noticed that my character lags behind the actual object, and it results like “jittering”/choppy movements. Is there any way to fix this? Thanks for any help! :slight_smile:

Video:
sBFUCQHujH

And note; it’s not the brick jerky back and forth, it just looks like it since the player is actually the one lagging behind.

Use a Constraint Mover instead of a script (because Roblox calculates physics at 240 Hz whereas scripts run at 60 Hz).

For example, I used an AlignPosition with MaxVelocity set to 2 and MaxForce set to 1000000000. I also used a BodyGyro with MaxTorque 400000, 400000, 400000 to prevent rotation.

Capture

xkhkhPVMTJ

7 Likes

Thanks! I’m going to stick with scripting because I need some functionality and versatility that I can only get with programming. But for anyone just wanting to make a plain, simple, and smooth elevator - then this is the way to go!

Edit: Actually, one last question. How hard is it to change the speed (also stopping movement fully), direction (up/down) and such with scripting - if I am using a constraint mover? Thanks for answers!

Movement stops automatically as soon as the AlignPosition reaches its target, so there’s no need for scripting. You can mess around with MaxForce and Responsiveness to change how strongly it tries to reach the target. MaxVelocity can make the AlignPosition move in a linear fashion.