Setting an angle instead of adding one

SUPER SIMPLE

I want the angle of the players head to be SET to the angle instead of it being added to it.


RunService.RenderStepped:Connect(function ()

	local xOrientation = math.asin(cam.CFrame.LookVector.Y)

	local xOrientationDegrees = math.deg(xOrientation)
	
	neckMotor.C0 = neckMotor.C0 * CFrame.Angles(-xOrientation,0,0)

end)

this line commands the program to set the CFrame to the previous CFrame + the new orientation
so instead just get rid of the previous CFrame, like this:

	neckMotor.C0 = CFrame.new(neckMotor.C0.Position) * CFrame.Angles(-xOrientation,0,0)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.