Smoothly move player?

How would I smoothly move a player forward about 4 studs? I’m trying to do this for a combat system I’m working on so the player doesn’t just stand in place all the time, but everything I tried was either choppy, didn’t work or looked bad.

Currently I insert a “BodyVelocity” into the player locally like this:

local forwardVelocity = Instance.new("BodyVelocity") 
forwardVelocity.velocity = Player.Character.HumanoidRootPart.CFrame.lookVector*5
forwardVelocity.P = forwardVelocity.P*4
forwardVelocity.maxForce = Vector3.new(10000,10000,10000)*999 
forwardVelocity.Parent = Player.Character.HumanoidRootPart

And it works fine locally, but to other players the character sometimes doesn’t even move or the movement is delayed which ruins my combat. I also tried doing the same but from the server and it still was delayed and not smooth. What can I do to make it work flawlessly every single time?

Use CFrame to move the HumaniodRootPart?

Try checking this out.

I do know how to use CFrame, I’ll try lerping the player and get back with my results.

TweenService is the way to go.

2 Likes

The best bet to make it smooth is to use TweenService or another method on the client it is being viewed on.

For example, one movement of a player will be processed, sent to the server, and the data then sent to every client. A LocalScript in the client will listen for the data then do what needs to be done.

As for making things happen without delay, you can’t; only in quantum mechanics can things happen instantly at this point in our technology.
And Roblox isn’t quantum lol