Garry's Mod Wiki

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( player.GetByID( 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: 35ms

DB GetPage 4
Generate Html 4
SaveChanges (1) 11
Render Body 0
Render Sidebar 13