Garry's Mod Wiki

Player:GetAimVector

  Vector Player:GetAimVector()

Description

Returns the direction that the player is aiming.

Returns

1 Vector
The direction vector of players aim

Example

Launches the player in the direction they're facing.

local ply = Entity( 1 ) ply:SetVelocity( ply:GetAimVector() * 1000 )