# SetJointMotorOn

## Description

Turns on a motor for the joint so that it moves continuously until prevented by a collision. Works on Line joints, Prismatic joints, and Revolute joints. Motors work by applying a force to achieve a set speed, if they meet resistance they increase the force until either the motor is moving at the desired speed or the maximum force specified is reached, at which point the motor will stop, continuing to apply the maximum force. In the case of linear joints the motor applies in one direction and either pushes the attached sprites together or apart.

## Definition

SetJointMotorOn( iJointIndex, speed, maxForce )

void agk::SetJointMotorOn( UINT iJointIndex, float speed, float maxForce )

## Parameters

- iJointIndex - The ID of the joint to modify.
- speed - The desired speed of the motor.
- maxForce - The max force it can use to achieve the speed.