Player/GetShootPos

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

Contents

Description

Returns the position of a Player's view

NOTE

This is the same as calling Entity:EyePos on the player.

Returns

Vector

aim pos

Examples

Example

Gets player 1's shoot position, and prints it to console

print( player.GetByID( 1 ):GetShootPos() )

Output:

A vector of the player's shooting position in the console.

Examples

Example

Prints the position of your player's camera, but using 3 different functions.

This example demonstrates that it doesn't matter whichever of these functions you use, you will get the SAME result.

// run on client
print(LocalPlayer():GetEyeTrace().StartPos)
print(LocalPlayer():GetShootPos())
print(LocalPlayer():EyePos())

Output:

94.856689 -115.472549 -83.981430
94.856689 -115.472549 -83.981430
94.856689 -115.472549 -83.981430
Personal tools
Navigation