Controlling Characters
In Chapter 6, we created our player character, the PlayerAvatar
class, and the BP_PlayerAvatar
blueprint. The next thing we want to do is to control the player character. Since the engine automatically generated the default PangaeaPlayerController
class when the project was created, moving the player character is already functional. However, that is not enough because we want more control over the player character.
In this chapter, you will learn how to add a new input action to the action map, handle an input event to trigger an attack, as well as how to add a notify to the timelines of attack, hit, and die animations.
This chapter will also introduce the concept of garbage collection, which is the engine’s important mechanism for memory management; the code for destroying characters demonstrates how to manually trigger garbage collection.
Additionally, you will learn how to create an enemy character and control the enemy with AIController
. This...