PlayerController
The Controller class has two main child classes: PlayerController and AIController. The PlayerController class is used by human players, while the AIController class uses AI to control the Pawn.
The Pawn and Character classes only receive input Events if PlayerController is possessing them. Input Events can be placed on PlayerController or Pawn. The advantage of putting the input Events in PlayerController is that these Events become independent of the Pawn, making it easier to change a Pawn class that is being possessed by the Controller class.
The following screenshot shows how to change a Pawn possessed by PlayerController in-game, and shows the use of the Possess Function. In this example, there are two characters in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access