Meteor Scripting Functions
Spatial
vector2 getPos(int objectID)
Get the position of a unit or player.

Example
// print player position
print("Player pos: " + getPos(getPlayer()));

See also
setPos

void setPos(int objectID, vector2 pos)
Set the position of a unit or player.

Example
// move player to 100, 100
setPos(getPlayer(), vector2(100, 100));

Comments
Server/single player can move any unit or player.
Multiplayer client can only move the local player.

See also
getPos

float getDir(int objectID)
Get the direction of a unit or player in the range 0-360.

Example
// print player direction
print("Player direction: " + getDir(getPlayer()));

See also
setDir

void setDir(int objectID, float dir)
Set the direction of a unit or player in the range 0-360.

Example
// rotate player south (only works if mouse look is disabled)
setDir(getPlayer(), 180);

Comments
Server/single player can set any unit or player direction.
Multiplayer client can only set the the local player direction.

See also
getDir


Index

Generated on the 15 May 2024 at 09:00:40 (UK Time)