▣
module · drop-in viewer
defaults
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.
by·posted 2mo ago
What it does
defaults
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, skinWidth }
Usage
local Defaults = require("@builtin::systems.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.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.