So currently ive been using the
physics.castSphere method with a small radius to find the closest of an object with a tag.
However this is pretty performance heavy so my question is, is there a way to optimize it?
i have also been looking at keeping a list of gameobjects and just looping through those however doing that a few times a frame for each object searching also seems rather performance intensive.
Here is my case:
50 individual characters on team 1
50 individual characters on team 2
each character has to find the closest of the character from the other team.
What is the fastest and least performance heavy way of doing it?