For loop with two variables
Hello!
I'm writing an attack script and i got a problem with a for loop : what i want to do is have something like this work :
for (int i = 0; i < enemiesToDamage.Length; i++) { enemiesToDamage[i].GetComponent<DropPlant>().DamageDropPlant(damage); enemiesToDamage[i].GetComponent<Enemy>().DamageEnemy(damage); }
the problem here is that when i test the game it only applies the first line of the for loop (in this case i'm only able to hit the "DropPlant"
i tried to write another for loop with the second line only but it didn't work.
Can you help me please get a for loop with those two variables working ?
Thanks! :D
Your answer
Follow this Question
Related Questions
Take damage only when attack animation is done? 1 Answer
random attack animations C# 0 Answers
Attack delay not working correctly 1 Answer