crystal.AISystem
A System that updates Navigation components.
When using the ShowNavigationOverlay command and sending this system a draw_debug notification, it draws the navigation mesh and all active paths using it.
Methods
| Name | Description |
|---|---|
| update_ai | Updates AI logic. |
Console Commands
| Name | Description |
|---|---|
HideNavigationOverlay | Stops drawing the navigation mesh and active paths. |
ShowNavigationOverlay | Starts drawing the navigation mesh and active paths. |
Examples
local MyScene = Class("MyScene", crystal.Scene);
MyScene.init = function(self)
local map = crystal.assets.get("assets/map/dungeon.lua");
self.ecs = crystal.ECS:new();
self.ai_system = self.ecs:add_system(crystal.AISystem, map);
end
MyScene.update = function(self, delta_time)
self.ai_system:update_ai(delta_time);
end