Watchful Minds: NPC Brains and Perception Kit
README.md
aiKit.Brain
Gives a character a brain and senses: entity.component.add("aiKit.Brain", { preset = "guard" }) on a synced entity. On the peer that runs it, it adds a navKit NavAgent (unless the preset does not move) and SecondWind health (unless it has some, or addHealth is off), senses ten times a second, remembers, and runs the preset's state machine or behaviour tree. Every peer builds the same body from the synced preset. Fields: preset, team, group, route, leader, active, addHealth, leash, leashCenter; read-only state, alert, phase, facing, pose, aiming, aimPoint, debugData. Changing preset while running changes its behaviour at once.