How to make Ai Follow the orders and copy the states of Commander AI or Player.

Hey was working on a game where the Ai would follow orders of the player or the other AI in game. For Example I wanted to post a video of a game that has something like what I am aiming for:

Basically, like in the video how the Player blocks with his shield the other Ai in his company throw up their shields and Block themselves as well. The commands for AI, I am getting a Basic understanding, thanks to a tutorial by Ryan Laley on Youtube. But I am trying to figure how the AI can do this. Is there any good Tutorials on this? Thank you in Advance for looking at this question.


I would say your best bet would be to save an array in game mode or game state of references to all characters to be affected, then when you change a value, say bIsBlocking, you access the array, loop through and flip their bools accordingly. If you wanted to avoid using framework classes, you could make a base character class that all relevant characters would derive from that contains the array mentioned above (static would be best but not essential if it’s not a big game).

If you wanted classes other than characters to respond, you could either make a base actor class or make an interface.

Ok Got the Ai To Spawn in a group thinks to a old RTS Template I bought a while back but now I have am trying to see if the Ai Can Attack, the good news is they due see the enemy and go for them, but sadly only the leading Ai an d not the others can attack. This is a problem I ran into with a RTS I am making. Anyone know what is up here is the code I think that is causing issues and some screens. Thanks everyone looking into this. The Scene in the code is speaking of is The Scene Component: