Adding the player classes
You are now ready to create some more main classes used by almost any UE game: those dedicated to managing the input from the player and showing the character in-game, along with its state.
The Player Controller is responsible for managing input from the player’s input devices (such as keyboard and mouse), and for sending commands to the player’s character so it will perform the corresponding actions. The Player Controller class is typically used to control a Pawn class or a Character class that represents the player in a game.
Finally, the Player State is a class that holds information about a player’s game state, such as experience points, score, and other relevant data. It exists on both the server and clients to ensure that all players have access to the same information.
Let’s create these three classes:
- Create a C++ class extending
PlayerController
and name itUS_PlayerController
. - Create another C++ class...