Editing ApplyHavokImpulse - ObjectReference

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 46: Line 46:


== Notes ==
== Notes ==
This function correctly moves the graphics and collision geometry, but the object is still considered to be on its old position. This creates a few problems:
* While the graphics and collision boxes are correctly moved by this function, [[GetPositionX - ObjectReference|GetPosition]] and [[GetAngleX - ObjectReference|GetAngle]] will return the old position. A workaround is to have a dummy, invisible, object and use MoveToNode to move it to one of your real object's nodes, then get the position of your dummy object. [http://forums.bethsoft.com/topic/1416758-addhavokballandsocketconstraint-questions/page__view__findpost__p__21667888 (source)]
* If you use SetPosition or MoveTo on the object, it will blink (return to its original position, then to its new position again).
* A side-effect of the previous bug is that if your object's original position is now a few cells away from the player, it will be unloaded by the game even if its graphics and collision box are close to the player. A workaround is to periodically update the position of your ship through [[SetPosition - ObjectReference|SetPosition]].
* If your object's original position is now a few cells away from the player, it will be unloaded by the game even if its graphics and collision box are close to the player. A workaround is to periodically translate your object to "self" through [[TranslateToRef - ObjectReference|TranslateToRef]]. This will not translate the mesh and collision geometry. However, if the translation completes, the position will be updated and you will see the object's mesh blink. To address this, you need to use [[OnTranslationAlmostComplete - ObjectReference|OnTranslationAlmostComplete]] and dynamically adjust the speed so that your object never reach itself.
* [[GetPositionX - ObjectReference|GetPosition]] and [[GetAngleX - ObjectReference|GetAngle]] will return the old position. If you need those informations, a workaround is to have a dummy, invisible, object and use MoveToNode to move it to one of your real object's nodes, then get the position of your dummy object. [http://forums.bethsoft.com/topic/1416758-addhavokballandsocketconstraint-questions/page__view__findpost__p__21667888 (source)]


Aside from that, this function will fail and throw a Papyrus warning if the reference has no 3D or if a zero-length force vector is used. Otherwise, the force vector will be normalized before the force is applied. A zero magnitude is permitted and force will still be applied (i.e. you won't displace the object, but you'll trigger Havok settling and any other side-effects of it being bumped).
Aside from that, this function will fail and throw a Papyrus warning if the reference has no 3D or if a zero-length force vector is used. Otherwise, the force vector will be normalized before the force is applied. A zero magnitude is permitted and force will still be applied (i.e. you won't displace the object, but you'll trigger Havok settling and any other side-effects of it being bumped).

Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see CreationKit:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)