getDistance on scriptEffectUpdate

Post » Tue Jul 12, 2011 2:12 pm

So, I have a script inside a spell that checks if npcRef.getDistance player is < 2 or some such, basically a very short distance akin to standing right next to the npc. However it seems no matter how far I am, the spell believes I'm under 1 unit of distance... Also, I'm using getContainer to get the ref of the npc affected by the spell. I tried getSelf before, but it did not work.
In short:

ref npcRef...begin ScriptEffectUpdateset npcRef to getContainerif npcRef.getDistance player < 2 ;Does not work as planned, seems to get activated no matter what distance there is between them...endifend


Would really appreciate any pointers on what I'm doing wrong. :brokencomputer:
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Return to IV - Oblivion