I am trying to implement a system in my RTS demo that detects all idle characters on the map and feeds this back to the HUD. I know how to do the HUD part and how to reference an idle unit using the get velocity node through the movement component, but I am just trying to figure out an optimal way of doing this without putting a cast; or a “Get Actors of All Class” node on a looping function or Event Tick.
What is the cleanest way of doing this? - ideally it would need to be checking at all times so I have no doubt that there will need to be some kind of looping function… but I am just curious if anyone knows a better way (If it exists)
Just to give an example of what I am trying to achieve - if you have played any of the Age of Empires games, you will know that if a villager is standing still and does nothing at any point during the game; they will be marked as Idle - this will then feed back to the HUD to show how many idle villagers you have on the map.