# 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

``` { .lua .api-signature }
joint:setMotorVelocity( targetVelocity, maxImpulse )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/Joint.md#setmotorvelocity)

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](../Game-Script-Environment/Userdata/Joint.md#settargetangle).

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `bearing` | [Joint](../Game-Script-Environment/Userdata/Joint.md) | The bearing. |
| `targetVelocity` | number | The target velocity. |
| `maxImpulse` | number | The max impulse. |
