So I’m trying to make an enemy that breaks apart when you look at them. I have been trying a couple ways to get this to work with moderate success but I now have a way to detect all visible enemies on my screen which stops working correctly when I cast to the enemy to break apart.
I start by getting all the actors that overlap with a vision cone that I created and attached to my FP camera. Then trace between the camera and enemy to see if I have a clear sight on the actor.
I then get all the actors hit in the trace and make an array so I can check if the hit actor has an “Enemy” tag. if it does I have a Line of sight on the enemy and it should then break apart. I’m doing this my casting to the Enemy_BP and making each part of the mesh fall off.
The issue I’m having is when I connect the Cast to Enemy_BP it stops detecting the enemies properly. I’m assuming its a problem with the custom event in the Enemy_BP but I don’t know what it could be