Enemy AI Attacking
Author: Austin Anderson
Posted on: 10/13/23
For the system build, one of the requirements was to have a game loop. Obviously, to complete a game loop, the enemies would have to be able to attack the player, so my "problems" arose as I was implementing the enemy. The following issues occurred: The enemy needed to move towards the player, the enemy needed to attack the player, the enemy needed to take damage, and the enemy needed to die. These were all relatively easy to figure out which is why I am talking about all of them rather than one specific problem.
The first issue was the enemy needed to move towards the player. I initially set this up in the enemy blueprint and called the AIMoveTo function, but I soon realized that the enemy would need a state machine and reimplemented it in the AI state machine. Next, the enemy needed to attack the player. Since the enemy did not have a weapon, I had to give it collision boxes on its hands. Once I had these set up in place on the hands, I needed to find and implement an attack animation. The current attack animation does not make sense and is a placeholder for later attacks. After that, the enemy needed to take damage, so I set up a health component for all things that take damage and made sure that whenever the player shoots the enemy, it would do damage towards the enemy's health. Finally, the enemy needed to die. I set up an "OnDeath" delegate that gets fired once the enemy's health is 0. This stops the enemy in its tracks, plays the death animation, and disables the enemies collisions.
Overall I had many issues arise, but I was not stuck on any of them for an extended amount of time. It has been a satisfying build so far and I am enjoying the AI side of the build.
Get Cyber Siege
Cyber Siege
Third-to-First person Castle Defense game
Status | In development |
Author | TheCodeCollective |
Tags | 3D, First-Person, Futuristic, Robots, Singleplayer, Third-Person Shooter, Tower Defense, Unreal Engine |
More posts
- Visual Impact: Enhancing Player FeedbackFeb 03, 2024
- Revamping Reticles: Adding Specific DynamicsFeb 02, 2024
- Spider Enemy Dying in the AirFeb 01, 2024
- Small Changes: Beginning vs End of developmentJan 27, 2024
- Airstrike TimerJan 25, 2024
- Overcoming Code Mazes: Transitioning to Radial Progress Bars in Unreal EngineJan 20, 2024
- Airstrike Power-UpJan 18, 2024
- Resuming the Journey: Maintenance & PlanningJan 13, 2024
- Drone Enemy Particle Effect BugJan 11, 2024
Leave a comment
Log in with itch.io to leave a comment.