The very first thing we are going to do is create a new Pawn class. In Unreal, the Pawn is the representation of a character. It handles the movement, physics, and rendering of a character.
Here's how our character pawn is going to work. The player is divided into two parts: there's the Pawn that, as mentioned earlier, is responsible for handling the movement, physics, and rendering. Then there's the Player Controller, responsible for translating the player's input into making the Pawn perform what the player wants.
Now, let's create the actual pawn.
Create a new C++ class and select Character
as the parent class for it. We will be deriving this class from the Character
class because Character
has a lot of built-in move functions that we can use for our field player. Name the class RPGCharacter
. Open RPGCharacter.h
and change the class definition using the following code:
UCLASS(config = Game) class ARPGCharacter : public ACharacter { GENERATED_BODY() /...