crashcat docs
    Preparing search index...

    Function walkStairs

    • Attempts to walk up stairs.

      1. Sweep up to find headroom
      2. Collect steep slope normals we're pushing against
      3. Move horizontally at elevated position
      4. Check that we made progress toward steep slopes
      5. Sweep down to find floor
      6. Validate floor is not too steep (or use forward test)
      7. Move to final position
      8. Override ground state to ON_GROUND

      Parameters

      • world: World

        the physics world

      • character: KCC

        the character controller

      • deltaTime: number

        time step

      • stepUp: Vec3

        up step vector (e.g., [0, 0.4, 0])

      • stepForward: Vec3

        forward step vector (based on velocity * deltaTime)

      • stepForwardTest: Vec3

        test distance for floor validation

      • stepDownExtra: Vec3

        extra down step after stair walk

      • filter: filter.Filter

        collision filter

      • listener: CharacterListener | undefined

        optional listener for callbacks

      Returns boolean

      true if stair walk succeeded, false otherwise