O'Reilly logo

Unity Game Development Scripting by Kyle D'Aoust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customization is key

It's time to customize our controls! We'll go over a couple of ways to add customization to our controls. Unity doesn't allow us to edit the input properties while in-game, so we will create a couple of ways to change the controls ourselves. In our game, we will utilize both these ways.

Swapping control schemes

Our first method will be to switch between preset control schemes. To start off, we'll add a bunch of variables that we will use for our controls:

string ControlScheme;
public KeyCode pcItem1, pcItem2, pcItem3, pcItem4, pcInv, pcPause, pcAttackUse, pcAim, xInv, xPause;

Since we can't modify the input properties, some of our controls will not be customized, such as movement, camera rotation, Xbox 360 Controller attack/use, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required