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
aim pos

Example

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

print( Entity( 1 ):GetShootPos() )
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

Page Links


Special Pages


Wikis

?

Render Time: 75ms

DB GetPage 19
Generate Html 2
SaveChanges (1) 45
Render Body 0
Render Sidebar 6