Settings describing the independent force (motor) applied to the constraint. Motor within a hinge constraint is used to create controlled, powered movement along the hinge's axis, allowing objects to rotate automatically or maintain a particular speed or position.

//@input Physics.ConstraintComponent constraintComponent

let constraint = script.constraintComponent.constraint;

let motorSettings = constraint.motorSettings;
motorSettings.enabled = true;
motorSettings.maxImpulse = 1;
motorSettings.targetType = HingeMotorType.AngleTarget;
motorSettings.targetValue = Math.PI/2;
motorSettings = motorSettings;

Constructors

Properties

enabled: boolean

Enable or disable motor settings.

maxImpulse: number

Maximum force allowed to be applied to constraint.

targetType: HingeMotorType

A type of the applied motor.

targetValue: number

Target value of the motor depending on type: speed or angle.

MMNEPVFCICPMFPCPTTAAATR