Documentation
    Preparing search index...

    Function arrive

    • Arrive (§12): seek target, but ramp the desired speed down inside slowRadius so the agent stops on it.

      d             = |target − position|
      desiredSpeed  = d < slowRadius ? maxSpeed · d / slowRadius : maxSpeed
      desiredVelocity = normalize(target − position) · desiredSpeed
      

      The ramp is linear in distance, and the closed form matters: at d = 0 the desired speed is exactly 0 and the desired velocity is exactly the zero vector, so an agent that is stopped on its target produces exactly (0, 0, 0) — no residual jitter, no epsilon dead-zone. Outside slowRadius arrive is bit-identical to seek.

      slowRadius <= 0 degenerates to seek (the d < slowRadius test can never hold), which is the useful reading of "no slow-down zone" and avoids a division by zero without a special case.

      Parameters

      Returns Vector3