Making CFrame More Smooth

		while wait(.1) do 
			local pos = Player.Character.HumanoidRootPart.Position + Player.Character.HumanoidRootPart.CFrame.LookVector*-4
			Ndragon.CFrame = CFrame.new(pos,Player.Character.HumanoidRootPart.Position)	* CFrame.new(3,0,0) * CFrame.Angles(0, math.rad(0), 0)
		end

How would I tween the script above to move more smooth instead of looking laggy.

Clip of script: https://gyazo.com/94d47ca9b8ccf607f4fd99a2cc191e22

2 Likes

Tween service?
TweenService (roblox.com)

How would I implement TweenService into the script above. I’m not really sure how to do that?

Something like this. I haven’t tested this, but it should work.

 local TweenService = game:GetService("TweenService")

        local info = TweenInfo.new(
        0.1, -- time for transition
        Enum.EasingStyle.Linear -- type of style for the transition
        )	
        while wait(.1) do 
        			local pos = Player.Character.HumanoidRootPart.Position + Player.Character.HumanoidRootPart.CFrame.LookVector*-4
                                TweenService:Create(Ndragon,info,{CFrame = CFrame.new(pos,Player.Character.HumanoidRootPart.Position)	* CFrame.new(3,0,0) * CFrame.Angles(0, math.rad(0), 0)}):Play()
        		end
2 Likes
while wait(0.1) do
				local Goal = {
					CFrame= CFrame.new(Player.Character.HumanoidRootPart.Position + Player.Character.HumanoidRootPart.CFrame.LookVector*-4,Player.Character.HumanoidRootPart.Position)	* CFrame.new(3,0,0) * CFrame.Angles(0, math.rad(0), 0)
				}
				local Tween_Info = TweenInfo.new(0.1,Enum.EasingStyle.Linear)
				local Tween = TweenService:Create(Ndragon,Tween_Info,Goal)
				Tween:Play()
end

while its not the most clean code u get the basics

2 Likes