Enemy Defense Mechancis - Kelsey 10/13/2023
The team wanted to set up a defense mechanic for the player laying down a barrier to protect the base from enemies. For this to work the enemies had to be stopped and attack the barriers before continuing to the bases. The first implementation of this was to set up a check in the player attack collider to see if the enemy was close to the barrier and then to have the AI Move TO function go towards the barrier. When setting up the NPC attack functionality this worked perfectly. When trying to do the same with the barriers the enemies walked right past the barrier and continued to head towards the base. (Shown in picture above)
After trying out a couple of different things the solutions were to use while loops in two different places. There’s a while loop int eh begin play function that checks if the barrier is valid and to head towards the barrier, then there’s a check for the while loop that is if the barrier still has health to continue to head towards the barrier The other while loops in the component end overlap for the player attack collider. This while loop is the same but also includes the attack function for the enemy. The while loop being in the component end overlap ensures that the enemy still heads for the barrier even if they try to walk out of distance. On the component begin overlap it just heads to the barrier and attacks. For this to work we also needed to add a Boolean to enable and disable barrier attacks and base following.
Get MystiMayhem
MystiMayhem
Mysti Mayhem is an action RPG where the player uses magic abilities to defeat monsters in different parts of her realm.
Status | In development |
Author | lotuslions |
Genre | Role Playing, Action |
Tags | 3D, Unreal Engine |
More posts
- Enhanced Input for Inventory -Kelsey 12/13/2023Dec 14, 2023
- Enemy Projectile Overlapping - Kelsey 12/06/2023Dec 07, 2023
- Fixing Enemy AI Aiming - Kelsey 11/29/2023Nov 30, 2023
- Player Model Animation Blueprint - Kelsey 11/15/2023Nov 15, 2023
- Enemy Projectiles - Kelsey 11/8/23Nov 09, 2023
- Enemy Death Animations -Kelsey 11/1/23Nov 01, 2023
- GPU Driver Crash - Kelsey 09/29/2023Sep 30, 2023
- Enemy AI Mechanics – Kelsey 09/20/2023Sep 21, 2023
- Unreal C++ Errors – Kelsey 09/15/2023Sep 15, 2023
Leave a comment
Log in with itch.io to leave a comment.