Joint.setMotorVelocity
Sets the motor velocity for a bearing. The bearing will try to maintain the target velocity with the given amount of impulse/strength.
Kind: Function
Environments: Game
Game
joint:setMotorVelocity( targetVelocity, maxImpulse )
In Scrap Mechanic, the Gas Engine increases both velocity and impulse with every gear. The Electric Engine increases velocity, but maintains the same impulse for every gear, making it sturdier.
This method cancels the effects of setTargetAngle.
Parameters:
| Name | Type | Description |
|---|---|---|
bearing |
Joint | The bearing. |
targetVelocity |
number | The target velocity. |
maxImpulse |
number | The max impulse. |