Difference between revisions of "Getpos"

From Valve Developer Community
Jump to: navigation, search
(The player entity also reacts to _exact commands, mainly by resetting its animations)
m (setpos and setang: .)
 
Line 13: Line 13:
 
These two commands also have <code>_exact</code> variations.
 
These two commands also have <code>_exact</code> variations.
 
*<code>setpos_exact</code> will automatically enable <code>noclip</code> 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 <code>setpos</code>.
 
*<code>setpos_exact</code> will automatically enable <code>noclip</code> 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 <code>setpos</code>.
*<code>setang_exact</code> works basically the same. Entities such as triggers, children and even the player entitiy itself will acknowledge when this command is used and may react to its use, unlike <code>setang</code>.
+
*<code>setang_exact</code> 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 <code>setang</code>.

Latest revision as of 21:05, 25 June 2018

getpos is a console command that prints the 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

setpos and setang

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: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.

These two commands also have _exact variations.

  • setpos_exact 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 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.