AI Collision and Decorator behavior problems
Author: Jordan Rarrat
Posted on: 06/13/2025
Part 1: The Problem
This week I ran into a critical issue with our enemy AI’s melee attack system. I had set up a collision box on the enemy character meant to detect when the player enters melee range. However, during gameplay, the OnComponentBeginOverlap event was never triggered, which meant enemies were unable to detect the player for attacks. This was a major problem because without the ability to detect the player in close range, enemies just stood there even during attack animations.
Part 2: The Solution
After debugging the issue and verifying that the collision box was being set up correctly in C++, I realized that while the component existed, it was not correctly attached or visible in the Blueprint version of the enemy on the map. I adjusted the SetupAttachment() in the constructor and enabled overlap events by setting the collision mode to ECollisionEnabled::QueryOnly and using SetCollisionResponseToAllChannels(ECR_Overlap). I also made sure that SetGenerateOverlapEvents(true) was called and that the delegate was bound to a UFUNCTION() to avoid runtime binding errors. Once these were in place, the collision began firing as expected. Now the enemy can detect when the player enters the attack box and trigger damage logic properly.
Get Zombats
Zombats
Third-person Ability Shooter
| Status | In development |
| Authors | Wombat Studios, JRarrat, Josh The Dark, iWannaNuhh, aabunada, Devon Flynn |
| Genre | Action |
| Tags | 3D, Third-Person Shooter, Zombies |
More posts
- Damage Feedback: Ragdoll Deaths and Screen FlashJun 27, 2025
- Shattering Expectations - Ben BissettJun 27, 2025
- Sometimes Math is HardJun 27, 2025
- The Journey to Multiplayer, Part 3 - Joshua NewtonJun 26, 2025
- Audio in C++ - Ali AbunadaJun 26, 2025
- Guns and Ballistics - Ben BissettJun 21, 2025
- Proper Ragdolling - Ali AbunadaJun 21, 2025
- Wave Based Spawning and Spawner ManagementJun 21, 2025
- The Journey to Multiplayer, Part 2 - Joshua NewtonJun 20, 2025
- Pause Menu DoublingJun 20, 2025
Leave a comment
Log in with itch.io to leave a comment.