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: