traversalKit.package
This package holds more than this page lists. See all of its files in its world.
README.md
ClimbFollower (traversalKit)
An NPC that follows a player everywhere, up walls included. Put it on an NPC body that walks on the built-in CharacterController with climbKit's ClimbMover and traversalKit's Traverser (add ClimbRig so it looks the part), or spawn one ready-made with kit.spawnFollower.
local K = require("traversalKit.kit")
K.spawnFollower({ position = { 0, 0, 10 }, feel = "armoured" }) -- follows the nearest player
It drives the body only through the controller's input bus, like a player's controls, so every move of the kit is open to it. On walkable ground it follows a path from navKit (NK.findPath; it bakes a grid map once if none exists). When the one it follows is higher and no walk gets there, it heads straight for them: climbable walls are climbed, low ones mantled, smooth ones run up, ropes and ladders climbed, ledges pulled over. While holding on it pushes toward them.
| Field | Default | |
|---|---|---|
target | none | entity to follow; empty = nearest player (with followNearestPlayer) |
followNearestPlayer | true | |
followDistance | 2.2 | stop this close (m) |
climbWhenHigher | 1.0 | go straight and climb when the target is this much higher and unreachable on foot |
speedScale | 1 | fraction of the body's move speed |
replanEvery | 0.8 | seconds between path plans |
bakeIfMissing | true | bake a navKit map once if there is none |
state | (synced) | idle, walking, climbing, waiting, lost |
Events: onStartClimb {height}, onReached. Only the peer that owns the NPC runs it.