Log inGet started
Package

kit.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

traversalKit.kit

The one interface for game code.

local K = require("traversalKit.kit")

K.equip(body, { feel = "nimble", assist = "standard" })  -- ClimbMover + Traverser + ClimbRig
K.mark(rope, "rope")                                       -- climbable on purpose, as a rope
K.mark(glass, "stone", false)                              -- never climbable
K.setFeel(body, "armoured")                                -- swap while running
K.setAssist(body, "arcade")
print(K.state(body).mode)                                  -- grounded, climbing, hanging, vaulting, balancing, …
K.on(body, "onGrab", function(e) print("grabbed", e.kind) end)
K.on(body, "onPullUp", function(e) print("over the top") end)
K.spawnFollower({ position = { 0, 0, 8 }, feel = "armoured" })  -- an NPC that follows players up walls
print(K.explain(wall, hit).reason)                         -- why it does or does not climb by rule
Function
equip(body, opts?)Adds climbKit's ClimbMover, Traverser, ClimbRig (unless rig = false) and ClimbCamera (unless camera = false). Works in a scene build or at runtime. Answers the Traverser.
mark(entity, kind?, climbable?)Adds or updates a ClimbSurface.
setFeel(body, name) / setAssist(body, name)Swap while running (on the body owner's peer).
state(body){ mode, hold, holding, balance, grip, feel, assist }, on any peer.
on(body, event, fn)Connect to a synced Traverser event.
spawnFollower(opts)Synced NPC climber with ClimbFollower.
explain(entity, hit?)The climb-by-rule verdict and its reason.

Also K.feels, K.assists, K.holds, K.rules, K.EVENTS, K.MODES, K.VERSION.