Unity Input System Rebinding: 10 Essential Steps
Imagine launching a new PC game.
The graphics look impressive, the gameplay feels responsive, and the environment is carefully designed.
However, the default controls don’t match your preferences.
Perhaps you prefer using different movement keys, want to change the interaction button, or need a more comfortable gamepad layout.
If the game doesn’t allow control customization, even a polished experience can become frustrating.
For developers, this highlights an important aspect of game design: players should have meaningful control over how they interact with a game.
Unity provides a flexible input framework that makes this possible.
With Unity Input System Rebinding, developers can allow players to customize keyboard keys, gamepad buttons, and other supported input bindings without rewriting gameplay systems.
This is particularly useful for PC and Steam games, where players may use different controllers, keyboard layouts, and personal control preferences.
However, building a reliable rebinding system involves more than changing a key assignment.
Developers must consider input architecture, control schemes, UI feedback, conflict detection, saving preferences, and testing.
This guide explains ten practical steps for implementing customizable controls in Unity.
1. Understand the Unity Input System
Unity supports multiple approaches to handling player input.
The older Input Manager relies on APIs such as Input.GetKey() and Input.GetAxis().
Although these APIs remain useful in compatible projects, Unity’s newer Input System provides a more flexible architecture for handling different devices.
What Makes the New Input System Different?
Instead of connecting gameplay logic directly to a specific keyboard key, developers define actions.
For example, a character controller may use actions named:
- Move
- Jump
- Interact
- Sprint
- Pause
Each action can have one or more bindings.
A Jump action might respond to the Space key on a keyboard and the south face button on a gamepad.
The gameplay script responds to the Jump action rather than checking each physical button separately.
This separation makes customization easier.
Unity’s official Input System documentation describes the package as a flexible alternative to the classic input system, supporting keyboards, controllers, touch devices, and other input hardware. Unity
Why Rebinding Matters
Different players have different preferences and accessibility requirements.
Customizable controls can make games more comfortable for players who prefer alternative layouts or use different input devices.
However, rebinding alone does not make a game fully accessible. Readable interfaces, adjustable settings, and other accessibility considerations remain important.
2. Install and Configure the Input System Package
Before implementing rebinding, configure the Input System in your Unity project.
Install the Package
Open Unity and navigate to:
Window → Package Manager
Select the Unity Registry and locate the Input System package.
Install a version compatible with your Unity Editor.
For example, Unity’s documentation lists Input System 1.20.1 as a released version for Unity 6000.3. Package availability varies by Editor release. Unity
Configure Active Input Handling
Open:
Edit → Project Settings → Player
Locate Active Input Handling.
Depending on the project, you can configure the newer Input System or temporarily support both input backends.
Projects migrating from legacy input should be tested carefully.
Create an Input Actions Asset
Inside the Project window, create an Input Actions asset.
A descriptive name such as GameControls makes the asset easy to identify.
This asset will contain the actions and bindings used by your game.
3. Organize Input Actions and Action Maps
A well-organized input architecture makes future development easier.
What Is an Action Map?
An Action Map groups related input actions.
For example, a PC simulation game might use separate maps for gameplay, menus, and vehicles.
| Action Map | Example Actions |
|---|---|
| Gameplay | Move, Jump, Sprint, Interact |
| UI | Navigate, Submit, Cancel |
| Vehicle | Accelerate, Brake, Steer |
| Inventory | Open, Close, Select |
This organization allows developers to enable or disable appropriate controls depending on the current gameplay context.
Example: Vehicle Interaction
Imagine a player exploring a garage.
While walking, the Gameplay action map handles movement.
When the player enters a vehicle, the game switches to vehicle-specific controls.
When the player opens the pause menu, UI navigation becomes the priority.
Unity’s Input Actions documentation explains how actions separate gameplay intentions from physical device inputs. Unity User Manual
Avoid Duplicated Input Logic
A common mistake is creating separate gameplay code for every controller type.
Instead, connect gameplay systems to actions and let the Input System resolve the appropriate bindings.
This makes the project easier to maintain.
4. Configure Keyboard and Gamepad Control Schemes
Control schemes help organize bindings for different input devices.
For example, a PC game may support both keyboard-and-mouse controls and gamepad controls.
Keyboard and Mouse Scheme
Typical bindings might include:
| Action | Keyboard Binding |
|---|---|
| Move | WASD |
| Jump | Space |
| Interact | E |
| Sprint | Left Shift |
| Pause | Escape |
Gamepad Scheme
Equivalent actions might use:
| Action | Gamepad Binding |
|---|---|
| Move | Left Stick |
| Jump | South Face Button |
| Interact | West Face Button |
| Sprint | Left Stick Press |
| Pause | Start/Menu Button |
These are illustrative mappings, not mandatory standards.
Why Control Schemes Matter
A game should recognize which devices are available and present appropriate control prompts.
For example, the interface might display “Press E” when the player uses a keyboard and a controller button icon when a gamepad is active.
Unity’s control schemes documentation explains how action assets can organize bindings for different device combinations. GitHub
Test Device Switching
Players may connect or disconnect controllers during gameplay.
The game should respond appropriately without requiring unnecessary restarts.
5. Implement Unity Input System Rebinding at Runtime
Runtime rebinding allows players to assign different controls while the game is running.
For example, a player might change the Interact action from E to F.
How Interactive Rebinding Works
Unity provides the PerformInteractiveRebinding() API.
When a rebinding operation begins, the system waits for an appropriate input and applies the selected binding override.
The following example demonstrates the basic implementation.
using UnityEngine;
using UnityEngine.InputSystem;
public class SimpleInputRebinder : MonoBehaviour
{
[SerializeField] private InputActionReference actionReference;
[SerializeField] private int bindingIndex;
private InputActionRebindingExtensions.RebindingOperation operation;
public void StartRebinding()
{
InputAction action = actionReference.action;
if (operation != null ||
bindingIndex < 0 ||
bindingIndex >= action.bindings.Count ||
action.bindings[bindingIndex].isComposite)
{
return;
}
action.Disable();
operation = action
.PerformInteractiveRebinding(bindingIndex)
.WithCancelingThrough("<Keyboard>/escape")
.OnComplete(op =>
{
Cleanup();
action.Enable();
})
.OnCancel(op =>
{
Cleanup();
action.Enable();
});
operation.Start();
}
private void Cleanup()
{
operation?.Dispose();
operation = null;
}
private void OnDestroy()
{
operation?.Dispose();
operation = null;
}
}
Important Implementation Notes
This example demonstrates a single binding.
It assumes the action reference is assigned correctly, the target binding is suitable for interactive rebinding, and the Escape key is available for cancellation.
Production systems should also preserve the action’s previous enabled state, handle composite bindings, exclude unsuitable controls, and manage conflicts.
The example does not include a complete settings interface or persistence system.
Unity’s official runtime rebinding guide explains interactive rebinding and emphasizes disposing of rebinding operations after use. GitHub
6. Design a Clear Control-Rebinding Interface
Technical functionality is only one part of a good control customization system.
Players also need an interface that clearly explains the process.
Display Current Bindings
A settings menu might show:
| Action | Current Binding | Option |
|---|---|---|
| Jump | Space | Rebind |
| Interact | E | Rebind |
| Sprint | Left Shift | Rebind |
| Pause | Escape | Rebind |
When the player selects Rebind, display a message such as:
Press a new key or button.
Provide Cancel and Reset Options
Players should be able to cancel a rebinding operation without changing the existing assignment.
A Reset to Defaults option is also useful.
Consider UI Readability
Buttons should be easy to identify, and the selected control should have a clear visual state.
For gamepad navigation, ensure that focus indicators remain visible.
This connects naturally with broader game interface design principles.
A technically correct input system can still feel frustrating if the settings interface is difficult to navigate.
7. Detect Conflicting Key Bindings
Allowing players to customize controls introduces the possibility of conflicting assignments.
Imagine a player assigning the same keyboard key to both Jump and Interact.
Depending on the game’s design, pressing that key could trigger two actions.
Different Types of Conflicts
Not every duplicate binding is necessarily a problem.
For example, using the same button for Interact during gameplay and Submit inside a menu may be acceptable if those action maps are not active simultaneously.
However, assigning the same button to two incompatible gameplay actions can create confusion.
Build a Conflict-Detection Strategy
Before accepting a new binding, compare it with other relevant active bindings.
If a conflict exists, the game can warn the player, reject the assignment, or offer to swap bindings.
Preserve Essential Controls
Some controls require special consideration.
For example, players should retain a reliable way to navigate menus and cancel actions.
Avoid creating a configuration that makes the settings menu inaccessible.
Test Composite Bindings
Movement commonly uses a 2D Vector composite with separate Up, Down, Left, and Right bindings.
Each composite part requires appropriate handling.
A simple rebinding implementation designed for one button should not be assumed to handle an entire movement composite automatically.
8. Save and Restore Custom Control Settings
Players expect their customized controls to remain available after restarting a game.
Unity provides methods for saving and loading binding overrides.
Saving Binding Overrides
The Input System supports serializing binding overrides into JSON.
For example:
using UnityEngine;
using UnityEngine.InputSystem;
public class InputSettingsStorage : MonoBehaviour
{
[SerializeField] private InputActionAsset actions;
private const string SaveKey = "CustomBindings";
public void SaveBindings()
{
string json = actions.SaveBindingOverridesAsJson();
PlayerPrefs.SetString(SaveKey, json);
PlayerPrefs.Save();
}
public void LoadBindings()
{
string json = PlayerPrefs.GetString(SaveKey, "");
if (!string.IsNullOrEmpty(json))
{
actions.LoadBindingOverridesFromJson(json);
}
}
}
When Should Settings Load?
Load saved overrides during initialization, before the player begins interacting with gameplay controls.
This prevents temporary mismatches between the displayed bindings and the actual input configuration.
Consider Save-System Architecture
PlayerPrefs is suitable for many simple preferences, but it is not an encrypted storage system.
Larger projects may use a dedicated settings or profile-management architecture.
Unity’s binding persistence documentation describes saving, restoring, displaying, and resetting binding overrides. GitHub
Test After Game Updates
Changes to action assets and bindings can affect previously saved configurations.
After modifying the input architecture, verify that older player settings still load correctly.
9. Test Custom Controls Across Different Devices
A rebinding system that works with one keyboard may behave differently with other devices.
Test Multiple Input Configurations
Relevant test scenarios include:
- Keyboard-only gameplay
- Keyboard and mouse
- Xbox-style gamepads
- PlayStation-style controllers
- Controller disconnection
- Switching between keyboard and gamepad
- Custom bindings after restarting
- Resetting default controls
Test Gameplay and Menus
Players should be able to navigate the main menu, customize controls, return to gameplay, and pause the game without losing input functionality.
Test Edge Cases
Check what happens when the player cancels rebinding, presses an unsupported input, or attempts to assign a conflicting key.
Also verify that a rebinding operation does not remain active after the settings menu closes.
Include Accessibility Considerations
Different players may prefer alternative button arrangements.
Where practical, avoid requiring simultaneous button combinations for essential actions without alternatives.
A well-designed input system should support customization without introducing unnecessary complexity.
For related production testing, GamePro Studio’s Unity Game QA Checklist provides broader guidance on validating gameplay systems and performance.
10. Build a Maintainable Input Architecture
The final step is ensuring that the system remains manageable as the project grows.
Separate Input From Gameplay Logic
A character controller should respond to gameplay actions rather than depend on specific keyboard keys.
This allows control layouts to change without rewriting movement code.
Use Consistent Action Names
Descriptive names such as Move, Jump, Interact, and Pause make input assets easier to maintain.
Avoid unclear identifiers that become difficult to understand during development.
Document Supported Devices
Record which input devices the game officially supports.
For PC releases, distinguish between basic gamepad input, complete controller navigation, and full controller-only usability.
These are not necessarily the same level of support.
Review Controller Prompts
If players can switch devices, UI prompts should reflect the active bindings where practical.
For example, a button prompt should update when the player changes the Interact binding.
Avoid Unnecessary Complexity
Not every game requires a sophisticated control-management framework.
A small PC puzzle game may need only a few customizable actions.
A large simulation game with walking, driving, inventory, and building systems may require a more comprehensive architecture.
Build according to the project’s actual requirements.
Practical Example: Custom Controls in a PC Simulation Game
Consider a hypothetical PC supermarket simulation.
The player can walk around the store, interact with products, move objects, and operate a checkout counter.
The game supports keyboard and mouse controls, with optional gamepad support.
A practical input architecture could include three action maps.
Gameplay handles movement, looking, jumping, and interaction.
Inventory handles item selection, rotation, placement, and cancellation.
UI handles menu navigation, confirmation, and settings.
The settings menu allows players to change appropriate bindings.
When the player saves their preferences, the game stores binding overrides.
When the game restarts, those overrides are restored before gameplay begins.
During testing, the development team checks keyboard input, controller switching, duplicate assignments, and menu navigation.
This example illustrates a possible implementation rather than describing a completed GamePro Studio client project.
Common Unity Input System Rebinding Mistakes
One common mistake is changing bindings without providing clear feedback to the player.
Another is allowing conflicting assignments without considering whether the affected actions can execute simultaneously.
Developers may also forget to save binding overrides, causing custom controls to disappear after restarting.
Other problems include failing to dispose of rebinding operations, incorrectly handling composite bindings, and disabling actions without restoring their previous states.
Some games support gamepad movement but leave important menus accessible only through a mouse.
This creates an incomplete controller experience.
Finally, developers should test input changes in actual builds rather than relying exclusively on the Unity Editor.
A reliable rebinding system combines correct technical implementation with clear UI design and comprehensive testing.
Conclusion
Unity Input System Rebinding gives developers a flexible way to support customizable keyboard and gamepad controls.
By separating gameplay actions from physical input devices, teams can build control systems that are easier to extend and maintain.
However, successful implementation requires more than allowing players to press a different key.
Developers should organize action maps, configure control schemes, design clear settings interfaces, detect conflicts, preserve preferences, and test different input devices.
These considerations are especially important for PC and Steam games where players may expect keyboard and controller flexibility.
At GamePro Studio, we work across Unity development, game UI/UX, 3D environments, optimization, and PC game production.
Explore our game development services or contact GamePro Studio to discuss a new game project or improvements to an existing Unity game.
Frequently Asked Questions
What is Unity Input System Rebinding?
Unity Input System Rebinding allows players to change the keyboard keys, controller buttons, or other supported input bindings assigned to gameplay actions.
Can players customize controls while the game is running?
Yes. Unity supports runtime interactive rebinding through its Input System APIs. Developers must provide the appropriate interface and handle the rebinding lifecycle.
Can Unity save custom key bindings?
Yes. Binding overrides can be serialized and stored using a suitable persistence system, then restored when the game starts.
Does Unity Input System support gamepads?
Yes. The Input System supports compatible gamepads and allows developers to configure actions, control schemes, and device-specific bindings.
Is the new Input System required for every Unity game?
No. Existing projects may use the legacy Input Manager successfully. However, the newer Input System offers useful flexibility for multi-device support and customizable controls.