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
  • Creating a CharacterActionsAsset asset
  • Default actions (Demo)
  1. How to...
  2. Implementation
  3. Actions

Define your own actions

PreviousActionsNextUse the character actions

Last updated 3 years ago

Actions are part of the CharacterActions C# structure (CharacterActions.cs). In order to define your own actions, you would need to modify the structure internal fields in some way. Luckily for you, there is no need to manually do that. The recommended way to modify actions is by using a CharacterActionsAsset asset.

Individual assets don't matter, they are just pure data containers. The whole creation process will end up affecting one C# structure.

Creating a CharacterActionsAsset asset

  1. Right click over the project view.

  2. Go to: Create/Character Controller Pro/Implementation/Inpus/Character Actions Asset.

  3. Fill the lists with your data (name and type).

  4. Click the "Create Actions" button.

At the end, the CharacterActions structure will be updated with your data.

Default actions (Demo)

By default (after importing the asset), the character actions structure will contain the data used in the Demo (movement, jump, run, dash, etc). All the actions were created using the Default Character Actions asset included with the package:

If you don't want to start the process from scratch, then duplicate this asset (and put it outside CCP workspace). Once you have the copy, then you can start to add new actions (or remove existing ones) to your liking.

The Demo states use all the default actions from this asset file (jump, dash, run, and so on). This means that modifying these actions while using the demo content (e.g. NormalMovement) can end up causing compilation errors (depending on which action you remove).

Extending the default set of actions (by copy+pasting the default asset) is the safest way to work with actions.

"Default Character Actions" asset