dacha
    Preparing search index...

    Class CharacterBody

    Makes an actor a character for CharacterController.

    Set velocity to move the character. After each fixed step, read onGround, onWall and onCeiling.

    Hierarchy (View Summary)

    Index
    actor?: Actor

    The actor that has this component. It is undefined until the component is added to an 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: "surface" | "free"

    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

    • get upDirection(): Vector

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

      Returns Vector

    • set upDirection(value: Vector): void

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

      Parameters

      Returns void

    • Returns the component of the same class on the parent actor.

      Returns Component<object> | undefined

      The component, or undefined if the actor has no parent actor or the parent has no such component.

    • 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