Part Follow Player Smoothly

Hi,
i’m making a pet for my game and i want to make it to follow the player smoothly,
i made this simple and quick script but idk how to make the part follow the player smoothly

local function Render()
	Pet.CFrame = Player.Character.HumanoidRootPart.CFrame * CFrame.new(2, 2, 4)
end
game:GetService("RunService"):BindToRenderStep("RenderPet", 1, Render)
1 Like

Hello, you might want to look at TweenService. It can be used to smoothly translate the position of an object.

3 Likes

Try the BodyMover’s they’re really nice for this too.

Specifically this one:

You would want to constantly set the Position property.

local function Render()
     BodyVelocity.Position =(HumaniodRootPart.CFrame * CFrame.new(2, 2, 4)).Position
end
2 Likes

TweenService and Body Movers are your best options. It’s a little hacky, but another solution would be to connect your part to a humanoid and use humanoid:MoveTo. I strongly reccomend against that.

Change the BodyVelocity to BodyPosition.

1 Like