Playermodel always looking right when facing forward in viewport
8 replies, posted
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?
[b]Looking straight, gun shoots straight, but the player is LOOKING to the right:[/b]
[img]http://i48.photobucket.com/albums/f202/b1g4/playerangleerror.png[/img]
[b]EDIT: [/b] 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.
[QUOTE=CowThing;17283921]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.[/QUOTE]
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.
[b]Quick-Fix:[/b] 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" ).."\tp: "..pl:GetPoseParameter( "aim_pitch" ).. "\n" )
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.
[QUOTE=foszor;17286714]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.[/QUOTE]
Yea I was, sort of figured that. Sorry about not replying at all, school gets in the way...
Sorry, you need to Log In to post a reply to this thread.