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
  • Properties
  • Foot position (origin)
  • Orientation
  • Size
  • Scale
  1. Fundamentals
  2. Core

Character body

PreviousCharacterNextCharacter actor

Last updated 4 years ago

Properties

Foot position (origin)

The foot position is considered as the origin, a point of reference for everything. As is normally for character controllers, the origin is assumed to be the bottom most point of the character body. In this case is the bottom point of the capsule.

Orientation

The character is modeled as an upright capsule.

Size

Since this is a capsule-based character we need only to define the radius and the height to fully describe the size of the character. The CharacterActor will consider the character dimensions as:

Width=2×Collider.RadiusWidth = 2 \times Collider.RadiusWidth=2×Collider.Radius
Height=Collider.HeightHeight = Collider.HeightHeight=Collider.Height

The Width and Height values are represented with the body size (a Vector2).

In play mode the collider bottom offset will be automatically adjusted, depending on the current state (state vs unstable).

Scale

Even though the collider will be scaled just fine, the internal "physics size'' (responsible for physics queries) will not. So, it is NOT recommend to scale the character using the Transform component.

The character localScale should always be <1,1,1>< 1, 1 , 1 ><1,1,1>.

What if i want to scale my character?

Well, in that case you should scale the graphics object, not the character itself (root object). After that, the body size should be modified to fit the graphics.