System:
I have set up a system in which when the player has an invisible rectangle attached to their face, and when it overlaps with a specific actor, it will display a widget that informs the player to Press E. When the player presses E the actor is destroyed. This system works perfectly.
Issue:
However, when I duplicate the same actor and now have multiple instances of that actor an issue arises. When the player aims their head at the original Actor I placed in the level (I’ll refer to this actor it as Actor A) but does not press E, and changes to aiming at a duplicated Actor (I’ll refer to it as Actor B) and Presses E, Actor A will be destroyed and not Actor B. Actor B is only destroyed after Actor A is. However, if I don’t aim at Actor A and go straight to Actor B, and press E, Actor B is destroyed (the proper Actor)
Persists:
This issue persists if I add more Actor’s (I’ll refer to it as Actor C). If I were to aim at Actor B first and Actor A but then go to Actor C and press E, Actor B will be destroyed, after one press, and Actor A will be destroyed after another and finally Actor C after another. I filmed a Youtube video illustrating the issue visually. Link to Youtube video: UE4 || Question || Destroy Actor Not Targeting Desired Actor - YouTube
Inference:
I can infer that whatever Actor I add into the game world, the one that was the first to be placed down is the one that is destroyed first. Either that, or I am not casting to the proper actor in blueprints. I am wondering if there is a fix for this. I am relatively new to Unreal Engine 4 so any help would be appreciated, thanks!