How exactly would I instantiate a player targeting enemies from an array of enemies in C# to attack them and decrease their health?
I honestly don’t know if they are or aren’t. Right now in my player attack script I have code that looks like this.public GameObject target;
This allows me to drag an enemy onto here in the inspector window and from my knowledge that is how I can attack and hurt the enemy. I also have code stating if the player is ye high and the corresponding button is pressed then adjust the enemy’s health by -10.
Now if I have 5 enemies how do I hurt them all separately? Do I instantiate them?
I honestly have no idea.
public GameObject target;