Book Image

Learning C++ by creating games with UE4

By : William Sherif
Book Image

Learning C++ by creating games with UE4

By: William Sherif

Overview of this book

Table of Contents (19 chapters)
Learning C++ by Creating Games with UE4
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Variables and Memory
Index

Monster attacks on the player


There are a few different types of attacks that monsters can do. Depending on the type of the Monster character, a monster's attack might be melee (close range) or ranged (projectile weapon).

The Monster character will attack the player whenever the player is in his AttackRangeSphere. If the player is out of the range of the monster's AttackRangeSphere but the player is in the SightSphere object of the monster, then the monster will move closer to the player until the player is in the monster's AttackRangeSphere.

Melee attacks

The dictionary definition of melee is a confused mass of people. A melee attack is one that is done at a close range. Picture a bunch of zerglings battling it out with a bunch of ultralisks (if you're a StarCraft player, you'll know that both zerglings and ultralisks are melee units). Melee attacks are basically close range, hand-to-hand combat. To do a melee attack, you need a melee attack animation that turns on when the monster begins...