I cant find bug in my code (SOLVED)

(subevents hidden version)

i am sorry codes a bit messy. i am trying to repeat loop that create new balls and change “Ball” variable to 1 when BallCreate animation finished to repeat same process ( i tried with object timer but it still not working). but sometimes when there is many of same sprite they work a few minutes than they just freeze and not continue to repeat loop (every copy that seen on screen)

Hi Lion, that’s all a bit too much for me but I did notice one thing. I can’t see any difference between your conditions in this event. Did you mean to invert one of them?

1 Like

Thanks for the answer i was working on it for hours, i know it hard to detect even when i wrote code myself i cant find bug but for someone who didnt build this in his head much harder. i changed the bug you show and added mininum pixel limit to mobs work conidition and it solved problem maybe it was causing infinite loop somehow,

Update: looks like it just happen more rare but still happens, i found it happens exactly when my main character(Astro) get really close to other character(RDBoomerang one that cause bug) in right before ball created. i think somehow it cant decide its “Ball” variable of “RDBoomerang” 1 or 0

Once again I’m not the one who’s going to be able to identify any major logic problems. But on the third screenshot, I don’t think the subevents that are flipping the Ball thrower will ever happen because the parent event plays the Ball Create animation and changes the Ball thrower variable back to 0. And this meets the requirements for your first event in screenshot one/two to set thrower animation to walk.

And I’d recommend next time just to post the expanded events, not a screenshot of both.

1 Like

Hello, Lion! Like Bubble, that’s all a bit too much for me, but I believe that we can join forces! :handshake:

If you use the condition “Trigger once” with “Repeat for each instance” the event will be true just only one time. So, if it happens in one instance, it won’t happen in any instances anymore!

You need change your events of “Repeat for each instance” removing “trigger once” and putting another condition that makes it true only once. Using your first event like an example you can just remove the trigger once because your action already change the variable to 1 making your condition false.

I don’t know if these changes will be enough to make your code work like you want, but I know they will be necessary.

1 Like

Thanks Resterisko. i didnt know that, i will fix it.

i found the bug in the end its about repeat for each object event, i just apllied it to main event and expect to work with subevents too but you have to apply it to every subevents one by one