Await won't work between classes

sequential execution is not working with await:
Ive got multiple instance of class and waiting for each of them to execute.

for i in classes: # go thrue classes
 await i.Execute() # waiting for each to execute sequentially.

But after first class is executed, program wont execute next class and continue.
Each class can be executed with different time.
How to wait for Executing properly?

So what happens in your Execute function?

1 Like

Class returns 0 if everything is ok

In 1 screenshot “command” is a custom class that have Execute method.
And “_commands” is an array of them.

second screenshot is Execute method.

After first Execute parsing of array stops


i dont see where you set the _name and _anim, also what _is_async bool trying to do? and you set it outside it?

from reading the for node in cutscene.get_children(), you have many AnimationPlayer in the cutscene node?

The red dot by line 19 is a breakpoint, it halts execution so that you may debug that line of code. Click the red dot to remove it.

that’s a good find
the breakpoints doesnt reset on project reload?
i see a few times people got this issues with breakpoint making the game stop in the middle, but the breakpoint should say what it does and where it stops though , it’s not just randomly stop your game

No, breakpoints here because of debugging.
Wen “for” starts, first class is executed, but then “for” stops and rest of the game continuing normally.

1 Like

“_name” is name of animation node. “_anim” is name of animation. “_is_async” is a mark whether the executing “for” should wait for the class to execute.

Since you say it stops on first itteration, Could your animation be in loop mode?

1 Like

No, animation not in loop mode. Also we have that problem with all same structured classes. For example we have class with timer, and there’s still that bug.

I made a new topic with code and better context

I made a new topic with code and better context

I made a new topic with code and better context.