-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Game Development Projects with Unreal Engine
By :

In our Dodgeball
game, the EnemyCharacter
class will constantly be looking at the player character, if they're within view. This is the same class that will later throw dodgeballs at the player; however, we'll leave that to the next chapter. In this chapter, we will be focusing on the logic that allows our enemy character to look at the player.
So, let's get started:
Content Browser
inside the editor and select New C++ Class
.Character
class as the parent class.EnemyCharacter
.After you've created the class and opened its files in Visual Studio, let's add the LookAtActor
function declaration in its header
file. This function should be public
, not return anything and only receive the AActor* TargetActor
parameter, which will be the actor it should be facing. Have a look at the following code snippet, which shows this function:
// Change the...