SetMotionType - ObjectReference

Revision as of 13:27, 27 August 2019 by imported>Ice Eyes (→‎Syntax: Corrected parameter name)

Member of: ObjectReference Script

Sets the object's havok motion type. This function is widely used as part of the included defaultDisableHavokOnLoad script, which is intended to make physics-enabled objects behave as if they were static.

Syntax

Function SetMotionType(int aeMotionType, bool abAllowActivate = true) native

Parameters

  • aiMotionType: New Havok motion type. Allowed values are:
    • Motion_Dynamic: The object will be simulated by Havok (fall, etc...)
    • Motion_Keyframed: The object will NOT be simulated by Havok (will only move if forced to, through SetPosition() or TranslateTo())
  • abAllowActivate: If setting the motion type to Dynamic, whether the object should start simulating right away. Otherwise, it will remain in it location until activated (hit by something).
    • Default: True

Return Value

None.

Examples

; Set the rock to no longer be simulated
Rock.SetMotionType(Rock.Motion_Keyframed)


; Set the rock to be simulated, but not to move until touched
Rock.SetMotionType(Rock.Motion_Dynamic, false)

See Also