Difference between revisions of "GetDistance"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
(linked to Oblivion Units article)
imported>Scruggs
(A little wonky when called on swimming actors)
Line 18: Line 18:
  end   
  end   
   
   
==Notes==
*[[GetDistance]] isn't completely accurate when called on an actor who is swimming. For instance, '''player.getDistance player''' will return a value within the range of 95.0 to 110.0 while the player is swimming.


[[Category: Functions]]
[[Category: Functions]]
[[Category: Movement Functions]]
[[Category: Movement Functions]]
[[Category: Condition Functions]]
[[Category: Condition Functions]]

Revision as of 14:06, 7 February 2007

Returns the distance in units from the calling object to the Reference "ObjectID".

Syntax:

GetDistance ObjectID

Examples:

GetDistance TestMarkerRef
Set distance to Getdistance Player
Ref Actor
 
Begin OnActivate 
  set Actor to GetActionRef 
  if Getdistance Actor > 70
    messagebox "Come closer my friend"
  endif
end  

Notes

  • GetDistance isn't completely accurate when called on an actor who is swimming. For instance, player.getDistance player will return a value within the range of 95.0 to 110.0 while the player is swimming.