navKit: navigation and crowd agents
Give anything in your world a sense of direction. navKit bakes where your level can be walked, and agents find their way across it, step around each other, climb, jump, teleport and get out of trouble. You don't write any pathfinding code.
What you get
- A walkable map in one call, baked from your level's colliders and terrain. There are three kinds: a fine grid, a light waypoint network, and a multi-level map whose floors are joined by links.
- NavAgent: put it on any entity and give it a target or something to follow. It smooths its path, slows down to arrive, avoids other agents, re-plans when something moves into its way and fires
arrivedexactly once each time it gets there. - Eight movement styles, each with its own look and swappable with one setting while running: walker, runner, heavy, flier, swarm, wheeled cart, sneaker and climber. Each style decides which links it takes: carts refuse ladders, fliers go straight over walls.
- Links between places: ramps, stairs, ladders, jumps, teleporters and doors that can lock and unlock.
- Movable obstacles: a crate pushed into a corridor re-routes everyone. When one lands on an agent, the agent is pushed clear to the nearest spot it can stand on and carries on to its goal, whatever its style and whatever the map kind.
- Click to move and debug drawing you can switch on and off (maps, paths and steering, on screen or with N).
- Multiplayer built in: the host moves the agents and every player sees the same crowd. Players who join late get it too: every agent, moving. Positions travel as one compact line instead of one update per agent.
- A test suite of 77 tests, and a README covering every call.
Two guides come with it
- How to make NPCs find their way: from start to finish for someone new to the kit. Making the walkable map for a level, sending characters somewhere or after the player, changing how they move, obstacles, crowds, ladders, jumps and doors, click to move, the debug view, multiplayer, and reacting when a character arrives or cannot get there.
- Build a crate yard where guards chase you: a small game, step by step. Guards (aiKit) patrol and chase you, you shove crates (pushKit) against the gaps to cut them off and they find another way round, villagers walk the market as a crowd and light the lanterns when they arrive, and every escape adds a guard.
Both turn up when you search ZeroMind for things like "how to make enemies find a path to the player" or "make a crowd walk across a square", and both link to the guides of aiKit, spawnerKit, weaponsKit and SecondWind.
Get going in a minute
Install navKit, add a NavMap to your level, and put a NavAgent on a character with a target. It walks there when you press play. The README's first example is the whole setup in a few lines of Luau.
The gallery (this world)
Press play and look around:
- Eight lanes, one per movement style, all moving at once.
- A plaza crowd of 30 crossing both ways.
- A maze on a fine grid and an open field on a waypoint network.
- A two-storey building on a multi-level map, with a ramp, stairs, a ladder, a jump gap and a teleporter.
- A corridor with a crate you can push (pushKit) to re-route the walkers. Stand on the red pad to drop a crate on a walker and watch it get out.
- A white capsule that walks wherever you click. Press N to see the maps and paths.
Also here: pushKit
Crates, boxes and carts that players shove by walking into them. The engine's player does not push physics bodies by itself; pushKit's one component does, for every player, in multiplayer.
Comments · 0
Open discussion, no rating attached. Ask questions, swap notes, follow threads.