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

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

See also
setPos

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

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

Comments
Server/single player can move any unit or player.
Can be called from server or client.

See also
getPos

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

Example
// print player angle
print("Player angle: " + getAngle(PLAYER_OBJECT));

See also
setAngle

float getDir(int objectID)
Alias for getAngle

See also
getAngle

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

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

Comments
Server/single player can set any unit or player angle.
Can be called from server or client.

See also
getAngle getDir

void setDir(int objectID, float angle)
Alias for setAngle

See also
setAngle

float getHeight(int objectID)
Get the height above the ground of an object.

Example
print(getHeight(PLAYER_VEHICLE));

See also
getMaxHeight

float getMaxHeight(int objectID)
Get the maximum height above the ground of an object.

Example
print(getMaxHeight(PLAYER_VEHICLE));

See also
getHeight


Index