Dr3n
July 15, 2023, 2:49pm
1
I made the changes from “Ignore Dead Enemies” and to test, I set two enemies in a row. But if I click on the first enemie in the row, the player starts to attack the 2nd enemie in this row:
After the 2nd enemie is dead, then I can attack the first one:
So, why (and how can I change this)?
Dr3n
July 15, 2023, 3:13pm
2
My actually solution is, to start in the foreach at the end:
foreach(RaycastHit hit in hits.Reverse())
But why has the RaycastHit-Array in default the last objects first and the first at last?
Actually, there is generally no guarantee in which order the hits will appear.
Later in the course, Sam will introduce a sorting method to the Raycasts which will ensure that they are all handled in order.
1 Like
system
Closed
July 31, 2023, 5:22pm
4
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.