getpos

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

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.