How do I move player smoothly?

Hi, I want to move the player by clicking a button I already made a script of it by moving
it’s HumanoidRootPart but It doesn’t move smoothly

Here is my script

local player = game.Players.LocalPlayer
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humRP = char:WaitForChild("HumanoidRootPart")
local button = script.Parent

button.MouseButton1Click:Connect(function()
	humRP.CFrame = CFrame.new(20,3,0)
end)

Please help

Smoothly? What do you mean? …

1 Like

like when the player click the button it will run on a specific area smoothly (like running)
the problem I’m having right now is that player will teleport when they click button
sorry for my bad english

Whats wrong with teleporting? Do you want to make the player run there?

yes exactly thats what i was wanting to get

You should look into this module: (Legacy) SimplePath - Pathfinding Module

Use MoveTo of the Humanoid to make the character move to where you want

button.MouseButton1Click:Connect(function()
	hum:MoveTo(Vector3.new(20,3,0))
end)

Keep in mind that if it can’t reach where you’re telling to go, it wont move you

1 Like

it work exactly what i wanted thanks

Glad to be of help! If you have anymore issues don’t be afraid to make another post!

1 Like