Duplicates of objects made when deleting and recreating them

I am making a game with the pathfinding engine and every time a bot dies, I want to delete it, wait 3 seconds and spawn it in again. Right now this somewhat works but every time a bot dies it makes another one of itself, even the player does this. How should I fix this?


you might need to zoom in to see all this

Where you’re checking if your timers are greater than 3 seconds, you add an object but you’re also restarting the timers. If you change them from reset to “delete … timer”. I think it will work.

Now, I didn’t read everything but it seems like you’re adding an enemy everytime one is killed. Can more than 1 enemy be killed before the 3 seconds have passed? If so, then the timer could be reset before the last 3 seconds has passed and only 1 object would be created. Just something to check.

1 Like