physics_joint_set_value

Certain joint properties can be changed and set even after the creation of the joint. There are a number of constants that can be used in this function and they can be found here: Physics Joint Constants.

 

Syntax:

physics_joint_set_value(joint, field, value)

ArgumentTypeDescription
jointPhysics Joint IDThe index of the joint that you wish to change
fieldPhysics Joint ConstantThe constant for the joint property that you wish to change
valueRealThe new value for the joint property

 

Returns:

N/A

 

Example:

if (physics_joint_get_value(revJoint, phy_joint_max_motor_torque) < 2)
{
    physics_joint_set_value(revJoint, phy_joint_max_motor_torque, 2);
}

The above code checks to see if the joints maximum motor torque is set to less than 2 and if it is it then sets it to 2.