Mod:Creation Kit/SetMotionType - ObjectReference

Member of: Mod:Creation Kit/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

 * 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 right away. Otherwise, it will remain in it location until activated (hit by something).
 * Default: True

Return Value
None.

Examples
Rock.SetMotionType(Rock.Motion_Keyframed) Rock.SetMotionType(Rock.Motion_Dynamic, false)
 * Set the rock to no longer be simulated
 * Set the rock to be simulated, but not to move until touched