Difference between revisions of "ApplyHavokImpulse - ObjectReference"
Jump to navigation
Jump to search
imported>JustinOther m (→Examples: Floatified float params) |
imported>JustinOther m (→Examples: Floatified) |
||
Line 42: | Line 42: | ||
; launch the skeever up into the air | ; launch the skeever up into the air | ||
Game.GetPlayer().PushActorAway(Skeever, 0.0) | Game.GetPlayer().PushActorAway(Skeever, 0.0) | ||
Skeever.ApplyHavokImpulse(0.0, 0.0, 1.0, 1000) | Skeever.ApplyHavokImpulse(0.0, 0.0, 1.0, 1000.0) | ||
</source> | </source> | ||
== See Also == | == See Also == | ||
*[[ObjectReference Script]] | *[[ObjectReference Script]] |
Revision as of 13:18, 8 October 2012
Member of: ObjectReference Script
Applies a Havok impulse force to this object of the specified direction and magnitude.
Syntax
Function ApplyHavokImpulse(float afX, float afY, float afZ, float afMagnitude) native
Parameters
- afX: X component of the force vector.
- afY: Y component of the force vector.
- afZ: Z component of the force vector.
- afMagnitude: The magnitude of the force vector - how hard to hit this object.
Return Value
None.
Examples
; Apply a physical force along the x axis with a magnitude of 5 to a cheese wheel
CheeseWheel.ApplyHavokImpulse(1.0, 0.0, 0.0, 5.0)
To get a heavy object like a weapon to go flying as if hit with a very large force you must use a magnitude such as 10,000:
;sends testaxe, a heavy object, flying across room
;along the positive y-axis
testAxe.ApplyHavokImpulse(0.0, 1.0, 0.0, 10000.0)
To get an Actor to react to a havok impulse, you may need to apply a "push" first.
; launch the skeever up into the air
Game.GetPlayer().PushActorAway(Skeever, 0.0)
Skeever.ApplyHavokImpulse(0.0, 0.0, 1.0, 1000.0)