Character Controller Pro (1.4.x)
  • Introduction
  • The package
    • Content
    • Versioning scheme
    • Importing the package
    • Using the package
    • Known issues
  • Fundamentals
    • Core
      • Character
      • Character body
      • Character actor
        • States
        • Stable movement features
        • Velocity
    • Implementation
      • Character state controller
      • Character state
      • Character brain
  • How to...
    • Core
      • Create a basic character
      • Add behavior logic to your character
      • Move the character
      • Rotate the character
      • Leave grounded state (e.g. jump)
      • Change the size of the character
      • Disable collisions (ghost)
      • Use the character information (with examples)
      • Use root motion
      • Detect a character using a "detector"
      • Add a static one way platform
      • Add a dynamic one way platform
    • Implementation
      • Organize the character hierarchy
      • States
        • Add and configure the state machine
        • Create a state
        • Transition from one state to another
        • Handle animation
        • Modify an IK (inverse kinematics) element
      • Actions
        • Define your own actions
        • Use the character actions
        • Use a custom Input Handler
        • Use the new input system
        • Create your own AI movement logic
Powered by GitBook
On this page
  • Input velocity
  • Pre-simulation velocity
  • Post-simulation velocity
  1. Fundamentals
  2. Core
  3. Character actor

Velocity

PreviousStable movement featuresNextImplementation

Last updated 4 years ago

This section explains how is the entire process behind the velocity calculation, from the beginning of the cycle until the end (after the simulation).

The CharacterActor component handles three important velocity values during each cycle (FixedUpdate):

Velocity

Description

Input velocity

This vector is read by the CharacterActor component in order to move from point A to point B.

Pre simulation velocity

Determining the final position might require the input velocity to change. This value is feed to the physics simulation.

Post simulation velocity

After the simulation is done, the velocity might change once again.

Input velocity

This vector is effectively the rigidbody velocity prior to the FixedUpdate call. It is called "Input" velocity since this is the value chosen by the user (gameplay logic).

In order to set up this value you just need to modify the CharacterActor velocity:

CharacterActor.Velocity = someValue;

Pre-simulation velocity

Technically speaking, this is the velocity created internally by the CharacterActor component, necessary to determinte the final destination of the character. This value is then fed to the physics simulation (hence the name).

Post-simulation velocity

After the simulation is done, the post-simulation velocity is the resulting velocity of the rigidbody. Pre-simulation velocity and post-simulation velocity might be different, especially if the character collided with another rigidbody.

The CharacterActor component allows you to choose which one of the three velocities mentioned before you want to re-assign as post-simulation velocity.