Input Manager

The Input Manager is responsible for storing all the input configuration data and making it accessible during runtime. You must always have one Input Manager in the scene or Rewired input will be unavailable.

IMPORTANT:

  • You may have one and only one Input Manager in the scene.
  • Do not disable or enable the Input Manager during runtime.

Creating an Input Manager

Create an Input Manager in the scene from the menu: Window -> Rewired -> Create -> Input Manager

Editing Input

The Rewired Editor allows you to create and edit input. Launch the Rewired Editor by clicking on the Rewired Input Manager in the scene hierarchy and clicking the "Launch Rewired Editor" button in the inspector.

Input Manager Inspector

Input Manager Inspector

Don't Destroy On Load When this is checked, the Input Manager will not be destroyed when a new scene is loaded.
Data Files An object reference to the ControllerDataFiles object. This object contains a list of all supported joysticks and templates and is required for Rewired to function correctly. If you want to customize your own list of supported controllers, you can link this to a separate copy of ControllerDataFiles that you have modified. (See Creating Controller Definitions for more information.)

 

Using the Rewired Input Manager in your game

For finished game builds, the Rewired Input Manager should exist in your initial game scene. Make sure "Don't Destroy On Load" is checked so Rewired will persist throughout the entire game session.

Testing Individual Scenes

If you need to do testing on an individual scene, you can create a prefab out of your Rewired Input Manager and use an instance of that prefab in the scene you're testing. Generally, it is not a good idea for a final game build to place the prefab in every scene because you will be destroying and re-creating the Input Manager (which will completely reset Rewired) with each scene load thereby invalidating Player, Controller, etc. object references, losing controller assignments, etc.

(Note: If you make a prefab out of the Rewired Input Manager, always open the Rewired Editor on the prefab, not the one in the scene or your changes will be applied to the scene instance.)

One way to achieve a setup that allows for both testing individual scenes at will and advancing through levels in your final game is to create a script that instantiates a prefab of your Rewired Input Manager on Awake. You can put this script on a GameObject prefab instance that you place in every scene of your game. On Awake, your script should check if a Rewired Input Manager already exists in the scene first, and if it doesn't, instantiate it. Leave "Don't Destroy On Load" checked in the Rewired Input Manager. Finally, be sure your script has a very low number set for its Script Execution Order -- it should execute before any other scripts (apart from Rewired's Input Manager) so that Rewired will be set up and ready by the time any other scripts in your game that rely on input make calls to Rewired.