Infinite Increment glitch?

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.

I see another execution line coming in right before the ‘list current car no’, what’s happening there?

Nothing, I was just testing a flip flop to see if I could have cars running both forwards and backwards on the same spline and it was pushed slightly up above because I planned to delete it after. There’s literally nothing unusual about the code, but it just permanently increments. The weird thing is I got rid of the original ++ increment function and replaced it with a custom node and then manually increment with get CurrentNumberOfCars add 1 and then set as CurrentNumberOfCars, but even doing this, it loops permanently. Doesn’t make a lick of sense to me. The branch stops firing once the number is higher than my max limit (4 in the video) but it keeps going up even when nothing is triggering it.

Where are you reporting the number of cars then?

Just using a print screen called off the custom event ListCurrentCarNumber which you can see is only called during this sequence.

That’s right, and this sequence isn’t called. That’s why I was wondering about that other line…

Here’s all of the code:

The print string was connected but I disconnected it temporarily while testing the map.


RandomizeVehicleMesh Function: