Help with making CFrame smoother

Hi, i am trying to make a model that always follows the player.
I used cframe but it somehow makes a delay to every movement made by the player.
here’s a vid of the situation:
https://gyazo.com/eb42d700ba14d7f1c206aac39807077e
script:

	while true do
		sign.PrimaryPart.CFrame = Humrp.CFrame
		wait()
	end

This is because wait() is deprecated and throttles. Use task.wait() or use RunService.Heartbeat.

	while true do
		sign.PrimaryPart.CFrame = Humrp.CFrame
		task.wait()
	end

or

local RS = game:GetService("RunService")

RS.Heartbeat:Connect(function()
	sign.PrimaryPart.CFrame = Humrp.CFrame
end)

Try updating the CFrame every frame, rather then every 30 milliseconds which might work.
The first reply to the thread shows the code for that.

local TweenService = game:GetService("TweenService")

local Tween = TweenService:Create(sign.PrimaryPart, TweenInfo.new(2), {CFrame = Humrp.CFrame})
Tween:Play()
Tween.Completed:Wait()

Alternatively you can use tweens which are purposed for some physics and all gui related animations. Changed the number in “TweenInfo.new(2)” to specify the length of time the tween (animation) should play for.

More information regarding the TweenService here:

1 Like