ApplyFanMotor - ObjectReference
Jump to navigation
Jump to search
Member of: ObjectReference Script
Applies a fan motor to the reference.
Syntax[edit | edit source]
Function ApplyFanMotor( string aTarget, float aAxisX, float aAxisY, float aAxisZ, float aForce, bool abOn = true ) native
Parameters[edit | edit source]
- aTarget: Name of the target scenegraph element that owns the rigidbody to which the motor will attach.
- aAxisX: Maximum rotational velocity around the x axis in radians/second.
- aAxisY: Maximum rotational velocity around the y axis in radians/second.
- aAxisZ: Maximum rotational velocity around the z axis in radians/second.
- aForce: Force of motor. This value will depend on the characteristics of the rigidbody so you will have to experiment.
- abOn: Initial On/Off state of the motor.
- Default: True
Return Value[edit | edit source]
None
Examples[edit | edit source]
Event OnInit()
;Apply fan motor to the FanBlades of the 3D of this object.
Self.ApplyFanMotor("FanBlades", 0.0, 0.0, 6.0, 5.0, true);
EndEvent
Notes[edit | edit source]
- Only 1 motor may be attached to a reference at a time. Attempts to add more than 1 will simply change the parameters of the previous motor. Any new target value will not take effect until the object is reloaded.
- The target object must be a dynamic object and should be constrained to a fixed base object with an unlimited hinge or wheel constraint.
- The rotational velocity is applied at the center of gravity location.