getdistance is zero until player moves?

Post » Wed Jul 27, 2011 11:32 am

Hi,

I'm running a script that monitors the distance between the player and an object like

 set Distance to Object.getdistance Playerif Distance < 1000    PrintC "You are getting hotter now only %g feet away" Distanceendif


However when I run this on a save where I am a bit out side of this range I get the message with 0 feet distance until the player moves!

Is this normal and how would I get around it?
User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Wed Jul 27, 2011 9:52 am

Nevermind I'm an idiot. Had the Object Reference getting assigned after I'd assigned the distance!
User avatar
Rob
 
Posts: 3448
Joined: Fri Jul 13, 2007 12:26 am


Return to IV - Oblivion