Hello, I’m optimizing my weapons system, I put the function for the player to look where the camera is pointing, the problem comes when the player points and moves, when the player does this his character does a kind of stuttering, but when does the same without moving the player rotates perfectly
my code here:
local x, y, z = workspace.CurrentCamera.CFrame:ToOrientation()
local facing = CFrame.new(self.Rootpart.Position) * CFrame.Angles(0, y - .3, 0)
self.FaceCFrame = facing
self.FaceCFrame *= CFrame.new(0,0,-15)
self.Rootpart.CFrame = self.Rootpart.CFrame:lerp(CFrame.new(self.Rootpart.CFrame.Position, Vector3.new(CFrame.new(self.FaceCFrame.Position).X, self.Rootpart.Position.Y, CFrame.new(self.FaceCFrame.Position).Z)), GeneralSet.LerpValue.Value)