Smoothing Angle

Hi, i created a tower and want to controll it with the mouse/view of the player



function ENT:Think()
	if self.owner != nil then
		self.neckAng = LerpAngle( 100*FrameTime(), self.neckAng, self.owner:EyeAngles() )
		self.neck:SetAngles(self.neckAng)
	end
	self:NextThink(0.02)
end


but it looks like this
[video]https://youtu.be/AKS71mU875c[/video]
(ingame 300 fps)
any ideas how i can smooth it better?

You need to return true if you are going to use NextThink. Also, it’s scaled by CurTime, not by a constant. Ex.


function ENT:Think()
   -- Code
   self:NextThink(CurTime())
   return true
end

thank you :), it worked perfect