Meteor 2 Scripting Functions
Physics
float getMass(int objectID)
Get the mass of an object in KG.

Example
float playerMass = getMass(PLAYER_OBJECT);
print("Player mass is " + playerMass + "KG");

See also
setMass

void setMass(int objectID, float mass)
Set the mass of an object in KG.

Example
// set player mass to 1000KG
setMass(PLAYER_OBJECT, 1000);

Comments
Set mass to 0 make object static (cannot be moved).

See also
getMass

vector2 getLinearVelocity(int objectID)
Get the linear velocity of an object in m/s.

Example
print(getLinearVelocity(PLAYER_OBJECT));

See also
getAngularVelocity

float getAngularVelocity(int objectID)
Get the angular velocity of an object in radians.

Example
print(getAngularVelocity(PLAYER_OBJECT));

See also
getLinearVelocity

bool getKinematic(int objectID)
Get the kinematic status of an object.

Example
if (getKinematic(PLAYER_OBJECT))
{
    print("Player is kinematic");
}
else
{
    print("Player is not kinematic");
}

See also
setKinematic

void setKinematic(int objectID, bool kinematic)
Set the kinematic status of an object.

Example
setKinematic(PLAYER_OBJECT, true);

Comments
Kinematic objects cannot be affected by forces, and cannot collide with static or other kinematic objects.

See also
getKinematic

void applyForce(int objectID, vector2 force)
Apply a linear force to the centre of an object.

Example
applyForce(PLAYER_OBJECT, vector2(10000,10000));

See also
applyImpulse applyAngularImpulse

void applyImpulse(int objectID, vector2 impulse)
Apply a linear impulse to the centre of an object.

Example
applyImpulse(PLAYER_OBJECT, vector2(20000,20000));

See also
applyForce applyAngularImpulse

void applyAngularImpulse(int objectID, float impulse)
Apply an angular impulse to an object.

Example
applyAngularImpulse(PLAYER_OBJECT, 10000);

See also
applyForce applyImpulse

void setCollidesWith(int object1ID, int object2ID, bool collides)
Set if an object can collide with another object.

Example
// Disable collision between the player and object ID 0
setCollidesWith(PLAYER_OBJECT, 0, false);


Index