[CODE]
local OldEyeAng = Angle(0,0,0)
local NewEyeAng = Angle(0,0,0)
function SWEP:CalculateSway(pos,ang )
NewEyeAng = Lerp(FrameTime()*10,NewEyeAng,self.Owner:EyeAngles() - OldEyeAng)
ang:RotateAroundAxis( ang:Right(), -NewEyeAng.x )
ang:RotateAroundAxis( ang:Up(), NewEyeAng.y )
ang:RotateAroundAxis( ang:Forward(), NewEyeAng.z )
OldEyeAng = self.Owner:EyeAngles()
return pos,ang
end
[/CODE]
I made some weapon sway code for a weapon base, and I'm having some issues.
When the player's Yaw eye angle transitions from -180 to 180 (or vice versa) it lerps all the way around my view.
Normalize your angles, stop breaking other HUDs in your HUDShouldDraw hook, stop using timers to modify your FOV, etc.
Also, it's clear where you steal code, since you only put semicolons in specific places.
[QUOTE=TFA;49109606]Normalize your angles, stop breaking other HUDs in your HUDShouldDraw hook, stop using timers to modify your FOV, etc.
Also, it's clear where you steal code, since you only put semicolons in specific places.[/QUOTE]
is it me or does it smell salty in here
Sorry, you need to Log In to post a reply to this thread.