I’m working on an Asteroids-type game and have started trying to implement respawning. The way it works now is that it simply finds the original spawn location (its own object) in the middle of the screen and spawns the player there with a few seconds of invincibility. What I’d like to do next is change the player’s spawn location to the area with the fewest nearby asteroids.
What I’m thinking of doing is using a Spherecast or OverlapSphere to find the nearby objects and then changing the position of the cast, probably with a for loop, until there are no asteroids within the radius. Is there an efficient/better way to do this?