nape-js API
    Preparing search index...

    Interface CharacterControllerOptions

    Configuration options for CharacterController.

    interface CharacterControllerOptions {
        characterTag?: CbType;
        down?: Vec2;
        filter?: InteractionFilter | null;
        maxSlopeAngle?: number;
        oneWayPlatformTag?: CbType;
        wallFriction?: number | null;
    }
    Index
    characterTag?: CbType

    CbType assigned to the character body (required if oneWayPlatformTag is set).

    down?: Vec2

    World-space "down" direction used for ground / wall raycasts.

    Default Vec2(0, 1) matches a standard top-down-Y platformer (gravity points along +Y). Override for radial-gravity / planet-platformer scenarios — set cc.down each frame to the unit vector pointing from the character toward whatever you treat as "down" (e.g. the nearest planet's centre). Walls are detected perpendicular to this direction.

    The vector is normalized internally; magnitude is ignored.

    Vec2(0, 1)
    
    filter?: InteractionFilter | null

    InteractionFilter used for ground/wall detection raycasts. When null, an auto-generated filter excluding the character's own shapes is used.

    null
    
    maxSlopeAngle?: number

    Maximum climbable slope angle in radians.

    Math.PI / 4 (45 degrees)
    
    oneWayPlatformTag?: CbType

    CbType for one-way platforms. When set, the controller automatically creates a PreListener that ignores collisions when the character approaches from below — matching the original nape Haxe engine pattern.

    wallFriction?: number | null

    Friction coefficient the controller applies to contacts with surfaces it does not treat as ground — walls, ceilings and slopes steeper than maxSlopeAngle. Ground contacts keep the friction derived from the two shapes' materials.

    A velocity-driven character that is pushed into a wall every frame generates a large normal impulse there, and material friction turns that into a tangential impulse big enough to cancel gravity outright: the character hangs on the wall (or the side of a ledge) for as long as the key is held, instead of sliding down. Overriding wall friction to 0 removes the hang while leaving floors and slopes untouched, so wall-slide / wall-jump logic layered on top sees the real fall speed.

    Set a small positive value for a natural "scrape" against walls, or null to disable the override entirely and use material friction everywhere (the behaviour before this option existed).

    0