SetMotionType - ObjectReference
Revision as of 11:00, 20 December 2011 by imported>JBurgess
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 aiMotionType, 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)