Creating the Input GameObject
Save the document and then maximize or select Unity. This will force the editor to compile the code that we have just written.
- On the left-hand side of the editor in the Hierarchy tab, right-click and select Create Empty. This will add a blank GameObject to the scene.
- Right-click on the GameObject that we just created and select Rename. Name it
- While still having the
Input GameObject selected, look to the right-hand side of the screen in Inspector and click on Add Component.
- When the search window pops up, enter the first half of what you called your input class. For example, when I enter
player, my Player Input class will appear in the list:
- Click on your input class to add it to the
Input GameObject. If everything ...