Table of Contents

Visual Script: Spatial Nodes

Spatial

The spatial system allows you to find nearby objects. Unlike using the physics engine for this, the spatial system is typically used to find tagged objects (see Marker Component). This is often useful for game logic.

For example, an NPC may want to find the closest health-pack, so it would use the spatial system to search for objects that use a health-pack marker. Other use cases include:

  • Proximity queries - Find objects within a certain radius
  • Nearest object search - Locate the closest object with a specific tag
  • Category filtering - Query objects by marker categories
  • AI perception - Allow AI to discover objects of interest in their vicinity

Spatial queries are more efficient than physics queries when you only need to find tagged objects, as they use a specialized spatial index optimized for this purpose.

See Also