phys_motor

From Source Entities
Jump to navigation Jump to search

Code classes:

phys_motor is a point entity present in all Source games. It tries to spin an object with a certain amount of force. The object being spun will still be affected by other forces, like gravity.

Bug: The object being constrained may sometimes rotate the wrong way when punted by the Hl2.pnggravity gun.

Flags[edit | edit source]

  • 1: Start On
  • 2: No world collision - If Hinge Object was set, make the Attached Object not collide with world brushes.
  • 4: Hinge Object - Makes the object "attached" to the motor. If not set, it will move around freely.

Keyvalues[edit | edit source]

Attached Object (attach1) <target_destination>
Object to apply force to.
Rotation Axis (axis) <vecline>
Defines one end of the axis to rotate the object on. (Other is this entity's origin.)
Rotation Speed (speed) <float>
How much force to apply.
System Interia Scale (inertiafactor) <float>
The motor's acceleration. Larger values will make the object speed up or slow down to the desired speed faster, and make it turn around sooner if it begins rotating the wrong way.
Bug: Big values can cause jiggling.
Spin up time (spinup) <float>
If set, Rotation Speed gets divided by this amount. Might be useful if the motor speed is changing in some dynamic way, such as by the position of a momentary_rot_button.
Additional Speed (Not in FGD) (addangaccel) <float>
An amount to add to Rotation Speed after it's divided by Spin up time. Might be useful if the motor speed is changing in some dynamic way, such as by the position of a momentary_rot_button.

Inputs[edit | edit source]

SetSpeed <float>
Sets Rotation Speed.
TurnOn
Turns the motor on.
TurnOff
Turns the motor off.

See Also[edit | edit source]