Skip to content

<s:btClosest> Node

This node is an adapter that helps us to find the closest entity of a given tag within a certain distance.

Prerequisites

Control entity must have btClosest script attached.

Attributes

<s:btClosest> node can receive the following attributes:

  • tagged (required) - which tag should be on the entities that would be considered for the search
  • within (optional) - distance in units within which to search for the closest entity, default to 100
  • writeTo (optional) - blackboard key to write the closest entity to, default to Closest

Example

Following would use <btClosest> to identify closest entity with btDoor tag within 500 units and write it to EnterBy key on the blackboard:

<s:btClosest tagged=btDoor within=500 writeTo=EnterBy>