This page is a work in progress and could be pending updates.

Execution Order


The execution order of the KCC's internal logic is important to take into account when extending it.

Back To Top

Simplified Execution Order

  1. KCC.SetInputDirection(): called from a player controller code before KCC internal update.
  2. KCC.SetLookRotation(): called from a player controller code before KCC internal update
  3. Another KCC API calls setting "input" properties
  4. KCC internal update
    1. Pre-caching KCC processors
    2. IKCCProcessor.SetInputProperties(): Dedicated stage to set input properties (ground angle, base position, gravity, ...).
    3. IKCCProcessor.SetDynamicVelocity():Dedicated stage to calculate KCCData.DynamicVelocity.
    4. IKCCProcessor.SetKinematicDirection(): Dedicated stage to calculate KCCData.KinematicDirection.
    5. IKCCProcessor.SetKinematicTangent(): Dedicated stage to calculate KCCData.KinematicTangent.
    6. IKCCProcessor.SetKinematicSpeed(): Dedicated stage to calculate KCCData.KinematicSpeed.
    7. IKCCProcessor.SetKinematicVelocity(): Dedicated stage to calculate KCCData.KinematicVelocity (combining Kinematic properties calculated in previous stages).
    8. Movement with calculated velocities. This step can be executed multiple times in a row if the desired velocity is too big (CCD is applied).
      1. Physics query.
      2. IKCCProcessor.ProcessPhysicsQuery(): Dedicated stage to calculate properties after single physics query (for example kinematic velocity ground projection).
      3. Collision update: IKCCProcessor.Enter() & IKCCProcessor.Exit() callbacks.
    9. IKCCProcessor.Stay(): Dedicated stage to execute custom processor logic.
    10. Transform synchronization.

For more info about processors and their stages, please check commented code and KCC sample project.

To Document Top