crashcat docs
    Preparing search index...

    Function stickToFloor

    • Sticks character to floor when leaving slopes. Prevents character from "bouncing" when walking down slopes or steps.

      1. Sweep down to find floor
      2. If floor found, move to contact position
      3. Update supporting contact state

      Parameters

      • world: World

        the physics world

      • character: KCC

        the character controller

      • stepDown: Vec3

        down direction and distance (e.g., [0, -0.5, 0])

      • filter: filter.Filter

        collision filter

      • listener: CharacterListener | undefined

        optional listener for callbacks

      Returns boolean

      true if floor found and character was moved, false otherwise