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
  • Movement
  • Velocy projection
  • Collide and Slide
  • Grounding
  • Step up/down
  • Edge Compensation
  • Dynamic Ground
  • Rigidbody interactions
  • Weight
  • Push
  1. Fundamentals
  2. Core
  3. Character actor

Stable movement features

PreviousStatesNextVelocity

Last updated 2 years ago

These features from the CharacterActor component (as seen in the previous section) will be applied only if the character is stable.

Movement

Velocy projection

Internally, when the character is stable, the CharacterActor component will project the input velocity (Linear Velocity) onto the current ground surface (Projected Velocity).

This process will always maintain the initial velocity magnitude, regardless of the slope angle.

Collide and Slide

This algorithm is responsible for determining obstacles along the way. If the encountered surface is allowed the character will walk onto it (maintaining always the displacement magnitude). if not, the slope will be considered as an invisible wall.

Grounding

Step up/down

This feature is responsible for putting the character on the ground (if there is one). There are two important values to consider:

  • Step up distance: Any stable surface below this height will be walkable by the character.

  • Step down distance: When losing contact with the ground, if the distance between the character and the ground is less or equal to this value, then the character will be automatically grounded (sticking to the ground). If there is no ground at all, then the character will be not grounded.

Edge Compensation

Normally, when a character is standing on an edge it collision shape will make contact with it. What edge compensation does is to lift up the capsule, simulating a cylinder shape.

This feature only works on edges, for slopes you will get the same results as before (with edge compensation disabled).

Dynamic Ground

If the current ground the character is standing on moves/rotates, then the character will move and/or rotate with it (only yaw rotation allowed).

A valid dynamic ground must be updated during the physics simulation. Here are some valid examples:

  • Kinematic rigidbody that moves/rotates using MovePosition/MoveRotation.

  • Kinematic/Dynamic rigidbody that moves/rotates based on an animation clip. The update mode must be AnimatePhysics (Animator component).

  • Dynamic rigidbody that moves/rotates using linear velocity, angular velocity, forces, torque, etc.

Rigidbody interactions

Weight

If the character is standing on top of a dynamic rigidbody, it will automatically apply a force downwards at the contact point, proportional to the rigidbody mass.

Push

The character can push other dynamic rigidbodies by colliding with them. It is also possible to ignore some rigidbodies by using a dedicated layermask:

​

Step up.
Step down.