Physics.HingeMotorSettings
ClassSettings describing the independent force (motor) applied to the constraint.
- Available on all platforms
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.
Index
Properties
Methods
Example
//@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;
Properties
enabled
enabled:
boolean
Enable or disable motor settings.
Default Value
false
maxImpulse
maxImpulse:
number
Maximum force allowed to be applied to constraint.
Default Value
0
targetType
targetType:
HingeMotorType
A type of the applied motor.
Default Value
Physics.HingeMotorType.AngleTarget
targetValue
targetValue:
number
Target value of the motor depending on type: speed or angle.
Default Value
0
Methods
getTypeName()
staticgetTypeName():TypeName<HingeMotorSettings>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<HingeMotorSettings>