getpos

From Valve Developer Community
(Redirected from Getpos exact)
Jump to: navigation, search

getpos is a console command available in all Source Source games. It prints the local player's position and view angle in the console in XYZ tuples.

A typical output looks like this:

setpos 8415.820313 -5248.870117 320.000000;setang -70.642090 71.564941 0.000000

The setpos and ;setang parts in the output above are for convenience; These are also console commands used for setting the player position and viewing angle. This lets the user copy the entire output line and paste it back into the console if they want to go to that exact spot again.

Note.png Note: When using setpos you may need to enable noclip to get to a position that would make the player become stuck inside something or when teleporting outside of the map.
Note.png Note: The commands for setting the player's position or angles require sv_cheats 1. The commands/convars for getting the player's position or angles don't require that, except for Counter-Strike: Global Offensive.
Console Command and Usage Availability[confirm] Description
getpos (in all games since Half-Life 2) Prints the local player's eye position (!) and angles.
setpos x y <z optional> (in all games since Half-Life 2) Move player to specified origin (must have sv_cheats).
setang p y <r optional> (in all games since Half-Life 2) Snap player eyes and orientation to specified pitch yaw <roll:optional> (must have sv_cheats).
getpos_exact Left 4 DeadLeft 4 Dead 2Dota 2Alien SwarmAlien Swarm: Reactive DropPortal 2Counter-Strike: Global OffensiveDino D-DayContagion Prints the local player's origin (!) and angles.
setpos_exact x y <z optional> (in all games since Half-Life 2) Will automatically enable noclip if moving to a position that would make the player become stuck inside something or when teleporting outside of the map. Entities such as triggers, children and even the player entity itself will acknowledge when this command is used and may react to its use, unlike setpos.
setang_exact p y <r optional> (in all games since Half-Life 2) Works basically the same. Entities such as triggers, children and even the player entity itself will acknowledge when this command is used and may react to its use, unlike setang.
setpos_player player_index x y <z optional> Left 4 DeadLeft 4 Dead 2Dota 2Alien SwarmAlien Swarm: Reactive DropPortal 2Counter-Strike: Global OffensiveDino D-DayContagion Move specified player to specified origin (must have sv_cheats).
Console Variable Availability Description
cl_showpos (in all games since Half-Life 2) Draw current position at top of screen.