Use the input layer to connect a player’s keyboard, mouse, controller, or on-screen controls to one Ultimate Character Controller character. Choose the input implementation before building the character so the Character Manager can create the correct components and references.

Choose an input route

Route Use it when UCC setup
Unity Input System A new project needs action assets, control schemes, or device pairing. Enable Input System in the Character Manager. UCC creates an Opsive Unity Input System component alongside Unity’s Player Input component.
Input Manager An existing project already uses Unity’s legacy axis and button mappings, or you want the supplied default mappings for a quick prototype. Leave Input System disabled and add the mappings from Setup Manager > Project. UCC creates a Unity Input component.
Rewired The project already manages actions and player identities with Rewired. Install the UCC integration, add Rewired Input, and assign it through Player Input Proxy.

The rest of UCC reads the common IPlayerInput interface, so abilities, camera input, and item input do not need to know which route supplies the values. An AI-controlled character is different: enable AI Agent in the Character Manager and do not add a player-input implementation.

Set up the Unity Input System

  1. Install and enable Unity’s Input System package. After Unity recompiles with the Input System active, the Input System option becomes available in the Character Manager.
  2. Open Tools > Opsive > Ultimate Character Controller > Setup Manager and select Project.
  3. Use Update Layers and the appropriate Render Pipeline setup. Do not select Update Buttons unless the project also needs the legacy Input Manager mappings.
  4. Open Tools > Opsive > Ultimate Character Controller > Character Manager, select or create the playable character, leave AI Agent disabled, and enable Input System.
  5. Build or update the character.
  6. On the character, verify that Player Input Proxy > Player Input references the Opsive Unity Input System component on the <CharacterName>Input GameObject.
  7. On that input GameObject, verify that Unity’s Player Input component has the supplied CharacterInput actions and uses the Gameplay action map. The Character Manager assigns both when it creates the input object.

If you replace CharacterInput with a custom action asset, keep the action names used by the character’s abilities and camera settings. The Opsive component looks up each requested input name in Unity Player Input’s current action map.

Set up the legacy Input Manager

  1. Open Tools > Opsive > Ultimate Character Controller > Setup Manager and select Project.
  2. Select Update Buttons under Input Manager Button Mappings. In a new project, the combined Update Buttons and Layers or Update Buttons, Layers, and Render Pipeline action can perform the same input update with the other required project setup.
  3. Open Tools > Opsive > Ultimate Character Controller > Character Manager, select or create the playable character, leave AI Agent disabled, and disable Input System if the option is visible.
  4. Build or update the character.
  5. On the character, verify that Player Input Proxy > Player Input references the Unity Input component on the <CharacterName>Input GameObject.

The default mappings include names such as Horizontal, Vertical, Mouse X, Mouse Y, and Jump. Custom mappings can use different names, but the corresponding ability, camera, and input-component fields must request those same names.

Connect Rewired

  1. Install Rewired and the current UCC Rewired integration.
  2. Configure the Rewired Input Manager and the actions used by the character.
  3. On the character’s input GameObject, replace the existing Opsive input implementation with Rewired Input.
  4. On the character, assign Player Input Proxy > Player Input to that Rewired Input component.
  5. Enable Enable Touch Controls on Rewired Input only when the project uses Rewired’s touch controls.
  6. For local multiplayer, give each character its own Rewired Input component and a different Rewired player assignment.

The integration package supplies the Rewired implementation; the UCC character still consumes it through the same Player Input Proxy. See Rewired for the integration-specific setup.

Add on-screen controls

  1. Open Tools > Opsive > Ultimate Character Controller > Setup Manager and select Scene.
  2. Under Virtual Controls Setup, choose Input Type:
    • InputSystem adds the on-screen controls for Unity’s Input System.
    • InputManager adds the legacy Virtual Controls Manager and its controls.
  3. Select Add Virtual Controls.
  4. Assign the intended character where the generated controls do not obtain it from the attached camera.
  5. Test the target input mode. The Opsive Unity Input System > Force Input choice is On Screen; the legacy Unity Input > Force Input choice is Virtual.

The legacy controls support virtual buttons, joysticks, and touchpads and must remain under their Virtual Controls Manager. See Virtual Controls, the direct child of this section, for their names and layout.

Understand input ownership

Each playable character needs its own Player Input Proxy and its own referenced input implementation. A Camera Controller reads the input of its assigned character; adding a second camera does not create a second player or separate devices.

For local multiplayer:

  • With Unity’s Input System, give each character a separate Opsive Unity Input System component and Unity Player Input component. Pair gamepads or control schemes through Unity Player Input. The shipped Opsive component deliberately makes keyboard and mouse available to every enabled player-input instance, so test shared keyboard behavior explicitly.
  • With Rewired, give each character a separate Rewired player assignment.
  • The legacy Input Manager exposes global axis names, not player identities. Use player-specific mappings and an implementation that distinguishes them, or use the Input System or Rewired when devices must be paired dynamically.

See Split Screen for the matching camera, viewport, and HUD setup. For a non-player character, use the Artificial Intelligence workflow instead of assigning local input.

Key choices

  • Look input names: Horizontal Look Input Name and Vertical Look Input Name must match the selected route’s mappings or actions. The supplied names are Mouse X and Mouse Y.
  • Look Vector Mode: Use Smoothed for UCC’s buffered look smoothing, Unity Smoothed for the input implementation’s smoothed values, Raw for direct values, or Manual when another system assigns the look vector, such as a tracked headset.
  • Look tuning: Adjust Look Sensitivity first. Change Smooth Look Steps, Smooth Look Weight, Smooth Exponent, or Look Acceleration Threshold only when Smoothed is selected and the default response does not suit the game.
  • Cursor behavior: Disable Cursor locks and hides the cursor while playing. Enable Cursor With Escape releases it, and Prevent Look Vector Changes prevents the released cursor from rotating the camera.
  • Input-mode override: Leave Force Input at None for normal platform detection. Use On Screen for the Unity Input System route or Virtual for the legacy route when testing touch controls in the Editor.
  • Repeated presses: Double Press Tap Timeout controls the time window used by tap and double-press checks.
  • Death behavior: Disable On Death stops the input implementation when the character dies and enables it again after respawn.

Verify in Play Mode

  1. Enter Play Mode and use the configured Horizontal and Vertical inputs. The intended character should move, and no other character should respond.
  2. Move the mouse or right stick. The assigned camera should look around using the selected smoothing mode and sensitivity.
  3. Press Jump or another input assigned to an enabled ability. That ability should start once, using the same action or mapping name shown in its Inspector.
  4. If cursor release is enabled, press Escape. The cursor should become visible and camera look should stop until the cursor is captured again.
  5. If the scene has on-screen controls, interact with each button and axis. The controls should affect the assigned character and should use the same names as the corresponding actions or mappings.
  6. In a local multiplayer scene, test one device at a time. Only its assigned character and camera should respond.

Troubleshooting

Symptom Check Fix
The character does not respond. Player Input Proxy > Player Input may be empty, or it may reference an input component from another character. Assign the character’s own Unity Input, Unity Input System, or Rewired Input component.
Unity Input System actions never fire. Unity Player Input > Actions or its current action map may be missing, or the requested action name may not exist in that map. Assign the intended action asset, activate Gameplay or the custom map, and make its action names match UCC’s input names.
Legacy movement works but an ability does not. The ability’s input name may not match an Input Manager button mapping. Add or correct the mapping, or change the ability to request the existing name.
The camera does not look around. Check Horizontal Look Input Name, Vertical Look Input Name, Look Vector Mode, and whether the cursor is released. Match the look names to the route, choose a non-Manual mode unless another system supplies look, and recapture the cursor.
Both local characters respond to one device. The characters may share an input component, Rewired player, Unity device pairing, or global legacy mapping. Give each character a separate implementation and player/device assignment; do not treat a second camera as input ownership.
On-screen controls are hidden or inactive. Virtual Controls Setup > Input Type may not match the character’s input route, or Force Input may select the desktop mode while testing in the Editor. Add the matching controls and temporarily choose On Screen or Virtual on the input component.
Input stays disabled after closing a menu. The system that sent OnEnableGameplayInput with false may not have sent the matching true event. Restore gameplay input when the menu closes or the interaction ends.

Developer reference

Read input through IPlayerInput

PlayerInputProxy implements IPlayerInput, so gameplay code can read the character-level interface without locating the concrete implementation. The interface supplies GetButton, GetButtonDown, GetButtonUp, GetAxis, GetAxisRaw, GetTap, GetDoublePress, GetLongPress, and GetLookVector.

using Opsive.Shared.Input;
using UnityEngine;

public class MyObject : MonoBehaviour
{
    [SerializeField] private GameObject m_Character;

    private IPlayerInput m_PlayerInput;

    private void Awake()
    {
        m_PlayerInput = m_Character.GetComponent<IPlayerInput>();
    }

    private void Update()
    {
        if (m_PlayerInput != null && m_PlayerInput.GetButtonDown("Jump")) {
            // Respond to the Jump press.
        }
    }
}

Enable or disable gameplay input

Send OnEnableGameplayInput on the character to disable or enable the input implementation, character locomotion handler, and attached camera input together. This is useful while a full-screen menu or another interaction owns the controls.

using Opsive.Shared.Events;
using UnityEngine;

public class GameplayInputToggle : MonoBehaviour
{
    [SerializeField] private GameObject m_Character;

    public void SetGameplayInput(bool enable)
    {
        EventHandler.ExecuteEvent(m_Character, "OnEnableGameplayInput", enable);
    }
}