# Aquafloat Motor

## How Aquafloat Motors Work

Motors apply forces to rigidbodies based on its throttle, turn, and boost input values. Aquafloat Seats will automatically alter these values based on player's inputs.

Motors will only apply their forces if the referenced `Floater` point is in water.

Motors also drive inputs for the MotorFX. See [Motor Effects](https://aquafloat.gitbook.io/aquafloat-docs/water-effects/motor-effects) page.

#### Changing Force Application

`ApplyRotationOnForwardInput` prevents the motor from applying any torque until there is a throttle input to move the vehicle forward.

`ApplyForcesAtForcePoint` makes the motor applies forces to the rigidbody at the specified point instead of the rigidbody center. This can simulate motors positioned at the rear of boats.

### Custom Motor Inputs

Aquafloat Seats are not required to control motors. You can write your own scripts and control methods to send throttle, turn, and boost values to the motor.

For example, you can create a ship with interact triggers to control turning left and right.

When a player interacts with the "Left" button, call the public `SetTurning(float turnAmount)` function on the motor with the value of -1 (Left Turn).

{% hint style="info" %}
Be sure to keep object ownership in mind when creating your own custom motor inputs. Only the owner of the motor should be setting throttle, turn, and boost values.
{% endhint %}

### Public Functions

`TakeControlAndActivate()` -> Grants ownership to the local player, activates the Motor, and activates any Motor FX.

`TakeControlAndDeactivate()` -> Grants ownership to the local player, deactivates the Motor, and deactivates any Motor FX.

`SetThrottle(float amount)` -> Set the throttle amount for the motor. 1 is full speed, -1 is full reverse.

`SetTurning(float amount)` -> Set the turning value of the motor. 1 is full right, -1 is full left.

`SetBoost(bool value)` -> Set if the boost is active or not.
