player.SetEyeAngles

From GMod Wiki

Jump to: navigation, search
Function
Syntax player.SetEyeAngles( Angle )
Where is this used?
Description:
Sets the angle of the player
Returns: nil
Part of Library: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.SetEyeAngles]Player.SetEyeAngles [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPoints the player at Ang.
Used onNewerServer.png
Code
 
-- Let's presume that pl is already defined
local Vec1 = Vector( 0, 0, 0 ) -- This is where we are going to look at
local Vec2 = pl:GetShootPos() -- This is where we are
local Ang = (Vec1 - Vec2):Angle() -- Gets the angle between the two points
pl:SetEyeAngles( Ang ) -- Sets the angle
 
OutputNone


Additional Info

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox