I have implemented 2 classes, Class A is the player character, and class B is an enemy that explodes when it gets close to the Player.
I am using NotifyActorBeginOverlap(AActor* OtherActor) events to achive this.
The situation looks as follows:
The problem is that since B explodes upon overlapping with A , and this is also triggered by the green collision sphere of A. I want it to explode only when its in radius of A (Once A is overlapping the blue sphere), excluding its collision sphere.
I can not disable Generate Hit events of A’s spherecomponent, because it needs the overlap events to help determine the closest enemy (sphere size changes dynamically based on proximity to closest enemy, if new enemy enters the sphere, change current target).
Is there any way to make this work?
Do i need to create a new actor for the A’s spherecomponent that follows A around? Isnt there a better way?