Player/SetEyeAngles

From Garry's Mod
Jump to: navigation, search
 Player:SetEyeAngles( )

Contents

Description

Sets the angle of the player's view (may rotate body too if angular difference is large)

Arguments

Angle angle

Angle to set the view to

Examples

Example

Points a player at Vector(0,0,0)

local ply = LocalPlayer() // Or any player
local vec1 = Vector(0,0,0) -- Where we're looking at
local vec2 = ply:GetShootPos() -- The player's eye pos
ply:SetEyeAngles((vec1 - vec2):Angle()) -- Sets to the angle between the two vectors

Output:

Local player will look at 0,0,0
Personal tools
Navigation