Facebook

Unity Character Controllers and Input Systems

by Michael Sacco Published January 10, 2024
The cover for Unity Character Controllers and Input Systems

In this article, explore two pivotal components within Unity: Character Controllers and the Input System.

1. Character Controllers

Unity’s Character Controllers simplify movement without the need for rigid bodies. Movement is collision-constrained, and the controller responds to the Move function.

When to Use Character Controllers?

Character Controllers find their prime application in first-person or third-person player control, excluding RigidBody physics. Utilizing these controllers necessitates coding each physics interaction for the character.

Properties of a Character Controller

  • Slope Limit: Limits the character to climbing slopes less steep than the given value (in degrees).
  • Step Offset: Allows the character to step up an obstacle only if closer to the ground than the specified value.
  • Skin Width: Indicates penetration level during collisions, acting like a layer around the character.
  • Min Move Distance: Specifies the minimum value a character cannot move below.
  • Center, Radius, and Height: Properties indicating the center, radius, and height of the character.

How to use Unity’s Character Controller?

  1. Select the character for movement.
  2. Click on “Add Component.”
  3. Search for “Character Controller” and click “Add.”
  4. Set the properties of the Character Controller.

2. Input Systems

Unity’s Input Systems empower users to control their games using external input devices. Unity supports two systems:

1. Input Manager

An older system integrated into the editor, comprising the Input Class and Input Manager. The Input Class has methods for listening to Virtual Inputs, while the Input Manager assigns real inputs to Virtual Inputs.

2. Input System Package

A newer, more flexible system allowing the use of any Input Device for game control. It is customizable but requires installation from the Package Manager, disabling the old Input Manager. Comprising six main parts:

  • Input Action Assets: Contain all inputs and controls.
  • Control Schemes: Define types of input devices.
  • Action Maps: Contain a set of actions.
  • Actions: Connect physical input to in-game events.
  • Bindings: Specify keys or controls.
  • Player Input Component: Connects all parts to the player object.

For more detailed information on these components, visit the Unity Docs.

Free download: Indie Game Marketing Checklist

Download now

Category

character controllers and input

Don't forget to share this post!

Popular assets for Unity

See all assets ->
    Cutting-edge volumetric fog and volumetric lighting with support for transparent materials.
    Volumetric clouds, day night cycles, dynamic skies, global lighting, weather effects, and planets and moons.
    A lightweight procedural skybox ideal for semi-stylized projects.
    Image-based Outlines for 2D and 3D games with variable line weight, color, and displacement options.
    Per-pixel gaussian blur on your entire screen, part of the UI, or in-scene objects.
    Drag-and-drop ready-to-use ambient, impact, and spell particle effects.

Free Indie Game Marketing Checklist

Learn how to make your game successful with this handy checklist.

Download for free