Problem with GetDistance()

Post » Tue Jun 19, 2012 5:18 am

Hey everyone,
I'm having a problem with the GetDistance() command in a script; Here is the script:
event OnUpdate()if myHorse.GetDistance(Game.GetPlayer()) > 256  meAsActor.UnregisterForUpdate()  meAsActor.SetVehicle(None)  myCart.TetherToHorse(None)  Utility.Wait(6)  myHorse.MoveToMyEditorLocation()  myCart.MoveToMyEditorLocation()  meAsActor.MoveToMyEditorLocation()endifendEvent

A bit of information: myHorse and myCart are both properties, and I've already done the import Utility. The actor that this script is attached to registeres for update with no issue via another script (Checked ingame with the showVars command). The script compiles fine too. However, my problem is the script seems to fire regardless of how far away the player is. I have changed the distance all the way to 1024, but it still seems to fire if the player is right beside the trader. Any ideas?
Thanks :smile:
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Tue Jun 19, 2012 4:46 pm

I'm sorry, I don't like bumping, but this script working properly is really important for my mod :/
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm


Return to V - Skyrim