Designing basic player input
Designing input that is intuitive, efficient, and simple is key to creating a game that players will come back to. Perhaps it's especially important in VR because your player won't be able to actually see any of the joysticks, buttons, and keys they press.
In this section, we'll put together the basics of input in a simple arena combat game that we'll continue to expand on throughout the rest of this book.
To get started, create a new Unity project called ArenaCombat
. Once the editor opens, create a folder in your Project window called Scenes
and save your blank scene in it with the name main.unity
.
Using Unity input axes
If you recall, we structured the main input in our PlayerController
script from Chapter 2, Stepping into Virtual Reality, by checking whether various keys had been pressed. This is a fine method for quickly testing functions, but in a full game, it's beneficial to have a more structured input system. Fortunately, Unity...