Playermodel always looking right when facing forward in viewport

For some reason I keep having this problem, then it will magically go away.
Right now, obviously I’m having the problem again on a gamemode I’m writing, anyone know the reason for it?

Looking straight, gun shoots straight, but the player is LOOKING to the right:

**EDIT: ** Oops wrong photo lol

I’ve had this too. I think it’s an animation problem, or something in the engine.

This problem existed on the FP fretta server too.

This has happened since Half-Life 2 was first released, all player models and NPC models don’t look exactly at their target all the time, even though they actually are.

You don’t exactly understand the problem. On the upper picture he look STRAIGHT ahead.

Yes I know he is looking straight ahead, but the problem is with the Source engine, this same problem happens on every single HL2 mod.

There are semi-fixes for it that you can apply with Lua but they don’t completely resolve the problem.
Quick-Fix: Untested
This function should be in a shared.
[lua] /---------------------------------------------------------
Name: gamemode:UpdateAnimation( )
Desc: Animation updates (pose params etc) should be done here
---------------------------------------------------------
/
function GM:UpdateAnimation( pl )

if ( !CLIENT ) then return; end

local yaw = math.Round( pl:GetAngles( ).y )
local rad = yaw * ( 3.141592654 / 180 )

if ( yaw < 0 ) then yaw = yaw + 360 end

pl:SetPoseParameter( "aim_yaw", math.sin( pl:GetAngles( ).y ) )
pl:SetPoseParameter( "aim_pitch", math.sin( pl:GetAngles( ).p ) )

Msg( "y: " ..pl:GetPoseParameter( "aim_yaw" ).."	p: "..pl:GetPoseParameter( "aim_pitch" ).. "

" )

end
[/lua]
This will change the way the player’s model rotates and looks up.

I have this problem when I’m testing gamemodes using the built-in thirdperson. Is that what you’re doing?

If so, once I get into multiplayer games everyone’s player model is aiming correctly, it’s just a bug with Valves thirdperson in Garry’s Mod.

Yea I was, sort of figured that. Sorry about not replying at all, school gets in the way…