For some reason that I cannot figure out, my code is infinitely incrementing even when it shouldn’t be. I’m basically trying to make a traffic spawning system. I’ve set it to stop spawning once a max number of cars has been reached. I set this limit to 4 and this works, however, for some weird reason the integer keeps incrementing even after it shouldn’t be anymore and I can’t help but think this is going to become a performance issue.
Here’s my code:
And here’s a video of the glitch.
I watch the branch stop executing and yet, it keeps incrementing which happens only on true. It’s also incrementing at weird times.