FindClosestActor - Game

Member of: Game Script

Finds the closest actor within a given radius of a location.

SyntaxEdit

Actor Function FindClosestActor(float afX, float afY, float afZ, float afRadius) native global

ParametersEdit

  • afX: center of the search, X component
  • afY: center of the search, Y component
  • afZ: center of the search, Z component
  • afRadius: Maximum distance from center to look for an actor

Return ValueEdit

The closest actor found, none if none.

ExamplesEdit

; Find the closest actor to 0,0,0, limiting the search to 5 units
Actor closest = Game.FindClosestActor(0.0, 0.0, 0.0, 5.0)

NotesEdit

  • The player is an actor, so this function can return the player if they are the closest actor to the passed coordinates.

See AlsoEdit