In the previous section, we implemented a script to move the character. However, if we hit Play, the character won't move, aside from idling. The reason lies in the fact that we have two functions to move the character, but no script calls them. If you go back to the Control Scheme section, you see that we need a Player Controller (or a UI interface in case of mobile games, but we will explore that later in Chapter 12, The Nature of Export), which sends the input to the Player. In this section, we are going to implement that script.
Create a new C# script and name it PlayerController. The script per se is very simple; however, we want to compile it only if the game is running either in the Editor or on a standalone version of the game (such as on Windows or macOS). As a result, we need to use compiler directives. So, after the name of the class, let&apos...