Hey y’all. I’ve been working on this zombies shooter game where the zombies spawn in waves. It’s been pretty good in terms of development so far up until this point. You see, my zombies don’t have smart pathfinding, so any wall that’s between them and the player is game over. My quick solution was to simply create as many spawners as I can, so no matter where the player is, there is always a zombie spawner within direct sight. One issue though is my current function has the script randomly pick one of these zombie spawners and spawn the zombie there. Obviously that won’t work considering the zombies can spawn in random parts across the map. Also there are doors you have to unlock with money, so if the plaeyr has no money and the zombie spawns on the other side, the game can’t continue.
So is there a way to script it so the game finds the closest spawner to the player out of all other spawners, and has the zombie spawn there?