characterController.module
README.md
defaults
In a world that installs the Controllers library (
world.installLibrary({ world = "034d26cf-dc3d-4123-abad-3944f97c6a60", as = "controllers" })), every package name on this page is written with@controllers::in front of it, andasset.list("component")lists each one under that name.
Default configuration presets for the character controller. Each
preset is a flat Config table that CharacterController.attach /
install merges over with user overrides. No behaviour, no state —
just constants.
Exports
M.standard: Config— baseline humanoid tuning. Used when no user config is supplied toattach.M.platformer: Config— higher gravity, stronger jump, double jump, generous coyote time, high air control.M.heavy: Config— taller capsule, lower max slope, weaker jump, minimal air control.
Types:
Config = { height, radius, maxSlopeAngle, stepHeight, gravity, jumpForce, coyoteTime, jumpBuffer, maxJumps, airControlFactor, groundSnapDistance, stepSmoothing, skinWidth }
Usage
local Defaults = require("characterController.characterController.data.defaults")
-- Use a preset directly:
CharacterController.attach(entityId, Defaults.platformer)
-- Or merge selective overrides:
local cfg = {}
for k, v in pairs(Defaults.standard) do cfg[k] = v end
cfg.jumpForce = 8.0
CharacterController.attach(entityId, cfg)
Notes
- Pure data, no engine calls. Safe to require at module load time.
- These tables are shared singletons — mutating
Defaults.standardin place will affect every laterattachthat uses it. Copy before mutating.