Garry's Mod Wiki

Player:GetShootPos

  Vector Player:GetShootPos()

Description

Returns the position of a Player's view

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

Returns

1 Vector
The position of the player's view.

Example

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

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

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