so I am having a issue with enemies in my game, health is currently controlled by 2 scripts, healthcontrol and enemycontrol.
all enemycontrol is meant to do is check if the player has run into a enemy and provide a variable (hurt) to a function in healthcontrol, playerTakeDamage(), all this does is check if the player has invincibility frames and then if not it takes the players current health and takes the int of hurt away from it.
Now that all works fine, but when I use a game object to give enemycontrol to healthcontrol so healthcontrol can use hurt it doesn’t work how I want it to.
my options for game objects to use are my 3 test enemies, one is Enemy and should deal 5 damage, one is Enemy1 and should do 10 damage, and the last one is Enemy2 which I set to do 15 damage, however when I give one of these to the healthcontrol script in Player, it makes the stats of the one I put in affect all of them, so when I put in Enemy it makes all 3 of them deal 5 damage which I don’t want, I want them all to use their stats.
I don’t know how to fix this or any other methods of getting hurt into healthcontrol that are better then the one I am using so if anybody could help me that would be very helpful, this is my first game.