Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Enemy Attack Order List.

$
0
0
I've programmed a Melee AI system where the enemy moves towards the target and attacks every so often. But I want to make it so when there is more than one enemy they take turns attacking instead of both attacking at the same time. So I figured I could use a list and a collider as a child of the player to add them into a Battlemanager script. Though I am completely unsure on how to add them to the list on entering the trigger, and then make them to only attack if they are position 0 in the list and once they have attacked to be put to the back of the list or if they are out of range / leave the trigger to be removed from the list. Any links to where I should look would be much appreciated, or even some code samples would be fantastic (I am working in C#) Unsure on where to start so no code samples :/ My knowledge of lists isn't that strong.

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>