Difference between revisions of "GetDistance"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>SJML Bot
(Bot creating condition functions pages.)
 
imported>DavidJCobb
m (That scripting syntax is from one of the older games, if I'm not utterly mistaken.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Returns the distance in units from the calling object to the Reference "ObjectID".
Returns the distance in [[unit|units]] from the calling object to the Reference "ObjectID".


'''Syntax:'''
'''Syntax:'''
Line 24: Line 24:


[[Category:Condition Functions]]
[[Category:Condition Functions]]
[[Category:Needs Skyrim Update]]

Latest revision as of 02:42, 5 February 2015

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  

Papyrus Version[edit | edit source]

ObjectReference.GetDistance (Papyrus)