SetMotionType - ObjectReference
Jump to navigation
Jump to search
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[edit | edit source]
Function SetMotionType(int aeMotionType, bool abAllowActivate = true) nativeParameters[edit | edit source]
- aeMotionType: 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 its physics right away. Otherwise, it will remain in it location until activated (hit by something). This is similar to the "Don't Havok Settle" option in the Reference window.
- Default: True
Return Value[edit | edit source]
None.
Examples[edit | edit source]
; 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)