I made instances of sprites called "SpawnSpell" and once I target an "Enemy" the SpawnSpell sprite is selected at a random instance and spawns a spell and targets an enemy to destroy it.
The problem is, sometimes when I click on an enemy to destroy it, the spell sprite tends to target another enemy, and not the one I intended t destroy. How can this issue be solved?
Here is my project file:
Thanks for the help!