Author Topic: SOLVED: Finding the brick that's closest to a player.  (Read 732 times)

I have a SimGroup that contains bricks. I want to find the brick that is closest to a player.
« Last Edit: January 05, 2013, 02:05:52 PM by Axolotl2 »

Step through every brick in the group. In each iteration, find the distance to the player and keep track of the lowest distance encountered as well as which brick had that distance. When you're done, the rest is up to you.

If there's going to be a lot, you might break it up into many SimGroups in a grid to optimize it.