I am currently in the process of making a game in gamemaker. The player attacks work by getting the players stamina and storing that in a damage variable, then flying out of the player and hitting the enemy, taking twice the amount of health off of the enemy as the damage variable had.
if the player had a stamina of 45 when performing the attack, the attack sprite will fly out with a damage of 45. When hitting an enemy this will deal 90 Damage to the enemy, leaving them with just 10 health.
The issue is the game doesn't appear to know which attack sprite has hit the enemy since you can perform an essentially unlimited amount of attacks, and therefore doesn't apply the correct amount of damage to the enemy.
How would I get an instance id of the object that collided with the enemy so I can use that to access the damage variable?
Thanks in advance