Hey guys, I am a bit lost here.
I have a Class SpawnManager that controls the spawns.
I have a Class Enemy that controls some stuff from the enemy.
I have a class EnemySO that is the scriptable object that controls some stuff like HP, damage etc for the enemy.
When I spawn the same anemy multple times, I am not being able to make that if I do damage to 1 of the 10 enemies that spawned, just for that enemy to take the damage.
All the others are taking too.. so if they have 4 life and I do 2 damage, and there are 10 enemies in the screen. If I hit 1 enemy once all the others will also have now 2 hp so I can hit 1time 1 enemy and 1 time the other and the second one hit will die because it lost also 2hp when I hit the first one.
How can I fix that?
SpawnManager code: https://paste.ofcode.org/35vLwUW9dqjXNyrUfEG6Z2C
Enemy Code: https://paste.ofcode.org/EaUzsA87tQsR4KwCrrj6F5
EnemySO Code: https://paste.ofcode.org/jZq8TTxVDDUpFv7tuYSPHq
If you need more info, please let me know.
thank you in advance.