dacha
    Preparing search index...

    Class CharacterBody

    Kinematic character controller state and movement settings.

    The controller system consumes velocity during fixed updates, performs sweep/slide collision handling, and writes the resulting target through the actor's kinematic rigid body.

    Hierarchy (View Summary)

    Index
    _displacement: Vector

    Pending one-step displacement consumed by CharacterController

    _needsRecovery: boolean

    Whether CharacterController should run overlap recovery

    actor?: Actor
    disabled: boolean

    Whether the controller should be ignored by CharacterController

    groundActor: Actor | null

    Actor providing the current walkable ground, or null when not grounded

    groundNormal: Vector

    Normal of the current walkable ground surface, updated by CharacterController

    groundSnapDistance: number

    Distance used to probe opposite upDirection and keep ground contact over small gaps

    maxRecoveries: number

    Maximum overlap depenetration iterations used when recovery is requested

    maxSlides: number

    Maximum sweep/slide collision iterations used during one fixed update

    maxSlopeAngle: number

    Maximum walkable ground angle in radians, measured from upDirection

    motionMode: CharacterMotionMode

    Controls contact classification and whether ground snapping is enabled.

    onCeiling: boolean

    Whether movement hit a ceiling during the last fixed update

    onGround: boolean

    Whether the controller is standing on walkable ground after the last fixed update

    onWall: boolean

    Whether movement hit a side wall or non-walkable surface during the last fixed update

    skinWidth: number

    Small distance kept between the character shape and blocking colliders

    velocity: Vector

    Desired character velocity in world units per second

    componentName: string
    • get upDirection(): Vector

      Direction treated as up for ground, ceiling, slopes, ground probes, and jumps

      Returns Vector

    • set upDirection(value: Vector): void

      Parameters

      Returns void

    • Adds a one-step world-space displacement request.

      The displacement is consumed by CharacterController on the next fixed update and is already expected to be scaled by delta time.

      Parameters

      Returns void

    • Requests overlap depenetration on the next CharacterController update.

      Returns void