Using magnitude with tons of different actors?

So I know how to use magnitude to determine the distance between two actors. But I am making a game kind of like a simplified "Colony" (you can find it on Armor Games) where you spawn actors and another person spawns actors. When two actors that are enemies see each other, they need to stop and start shooting, when one is dead, the other keeps moving until it gets within range of another enemy actor, and so on. So I was wondering how I could use magnitude in this situation, so that it applies to multiple different/same actors all in the same scene.

Comments

Sign In or Register to comment.