FindClosestActor - Game

From the CreationKit Wiki
Revision as of 16:26, 18 October 2011 by imported>Rhavlovick (1 revision: Clobber re-import by Henning)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: Game Script

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

Syntax

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

Parameters

  • 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 Value

The closest actor found, none if none.

Examples

; 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)

See Also