How to select what happens first

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Wrokin

Hi,
I have been trying to figure out some nice system for the animations I am using, originally I was just changing animations based on what was happening but after some thought I came to the conclusion that it would look much better if some animations continued in other animations. So I started working and tried couple of different things but in the end after finding out I can’t do some things I wanted to do I did it in a way that after one animation finishes depending on what type it is it would change some variable, I can’t change it at the start of the function as I am triggering some checks sometimes that have to start part new animation based on priority and if I did it at start it would mess with it so I have to do it at the end, the problem is that no matter in what order I connect the signals to the timer one always happens first which again will mess things up, wanted to ask if there is a way to change the order of things happening in these connections. Here is the part of code that I can’t seem to figure out.
t.set_wait_time((self.get_sprite_frames().get_frame_count(animation)-frame)/get_sprite_frames().get_animation_speed(animation)) t.connect("timeout", self, "animation_calculate") t.connect("timeout", self, "end_process_1") t.start()
Thank you for the time that you spent reading this.

:bust_in_silhouette: Reply From: exuin

If you’re using an AnimatedSprite, then there’s an animation_finishedsignal you can use instead of using a timer.

Well this seems much easier then making bunch of timers. Thank you so much this is something I was hoping existed but didnt even check.

Wrokin | 2021-03-31 09:24