Garry's Mod Wiki

Revision Difference

Entity:EyeAngles#546243

<function name="EyeAngles" parent="Entity" type="classfunc"> <description> Returns the direction a player/npc/ragdoll is looking as a world-oriented angle. <bug issue="2620">This can return an incorrect value in jeeps when used with <page>Player:EnterVehicle</page>.</bug> <bug issue="2620">This may return local angles in jeeps when used with <page>Player:EnterVehicle</page>.</bug> </description> <realm>Shared</realm> <rets> <ret name="" type="Angle">Local player's eye angle.</ret> <ret name="" type="Angle">Player's eye angle.</ret> </rets> </function> <example> <description>Print the local player's angles.</description> <code>print( LocalPlayer():EyeAngles() )</code> <output>When looking straight down, it might return `Angle(89, -175.38, 0)`.</output> </example> <example> <description>Fix the issue with vehicles when used with <page>Player:EnterVehicle</page>.</description> <code>print( LocalPlayer():GetVehicle():WorldToLocalAngles( LocalPlayer():EyeAngles() ) )</code> <code>print( LocalPlayer():GetVehicle():LocalToWorldAngles( LocalPlayer():EyeAngles() ) )</code> </example>