How to damage the player character by touching an AI blueprint?

I want to make code that will destroy the player character when it collides with a specific AI character. This AI is set to wander until it sees the character, in which case it chases it. I tried making a simple health bar that depletes when damage is applied by the AI, but it just didn’t work. Then I tried to set up a different health system in which it’ll take damage from collision. This came close, but I can’t figure out how to make it so that it only damages the player from collision with the AI.


Have you tried using event begin overlap on a collision (circle, box, capsule) component attached to your AI blueprint? Instead of event hit, use event begin overlap, the from the overlapping actor pin, cast to your player character and reduce the health / kill the character / do whatever you want. I think that might be what you are looking for…?

Open your AI and add a sphere or box collision. On Event Begin Overlap, use Apply Damage. And finally on Event AnyDamage, try setting the Health before the branch and then checking if its <= 0. There are many tutorials on this subject available online, so don’t hesitate to check them out. Good luck!