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

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

Generated on the 23 November 2024 at 08:20:43 (UK Time)