Difference between revisions of "Talk:SetPos"
Jump to navigation
Jump to search
→Havok, setPos, and MoveTo: added setPos, getPos, and swimming
imported>ABO (Added some observations about how havok interacts.) |
imported>ABO (→Havok, setPos, and MoveTo: added setPos, getPos, and swimming) |
||
Line 48: | Line 48: | ||
I've been doing some experiments and one thing to keep in mind is setPos is ignored by havok... so any velocity the object had before calling setPos will be retained, and havok will apply it's gravity and collision rules at the new position to update that velocity. This means if you do a "levitate" spell that uses setPos to hold the actor up in the air, the actor will accumulate velocity from gravity, so when your spell wears off he will slingshot into the ground. [[User:ABO|ABO]] 22:35, 21 May 2008 (EDT) | I've been doing some experiments and one thing to keep in mind is setPos is ignored by havok... so any velocity the object had before calling setPos will be retained, and havok will apply it's gravity and collision rules at the new position to update that velocity. This means if you do a "levitate" spell that uses setPos to hold the actor up in the air, the actor will accumulate velocity from gravity, so when your spell wears off he will slingshot into the ground. [[User:ABO|ABO]] 22:35, 21 May 2008 (EDT) | ||
=setPos, getPos, and swimming= | |||
Something very strange happens when swimming. If you do ''setPos X'' or ''setPos Y'' when swimming, the Z position will also be "reset" to a value that I think is supposed to put you at the surface of the water (-5 in my particular tests). If you do ''setPos Z'', it will move you vertically, but when you do ''getPos Z'' it will report a value about +90 above what you specified. This behaviour seems to change when you are under water vs swimming at the surface. The following piece of code will result in the player floating above the surface of the water [[User:ABO|ABO]]; | |||
set zp to player.getPos Z | |||
player.setPos Z zp |