Log inGet started
Package

traversalKit.package

Newest version

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.

FieldDefault
targetnoneentity to follow; empty = nearest player (with followNearestPlayer)
followNearestPlayertrue
followDistance2.2stop this close (m)
climbWhenHigher1.0go straight and climb when the target is this much higher and unreachable on foot
speedScale1fraction of the body's move speed
replanEvery0.8seconds between path plans
bakeIfMissingtruebake 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.