Chagil
Chagil

Reputation: 1

timer.performwithdelay() works without delay from transition.to ()

(if anything, this post has been translated through a translator from Russian into English)

For my play, I need the object to change smoothly with a delay, of course I decided to use transition.to() and timer.performwithdelay(). Everything worked fine on the first, second and third scenes, but as soon as I decided to finish the "menu", where a short scene was just shown, timer.performwithdelay() stopped working with a delay (which is why it was made). He just went straight to transition.to (), without delay.

At first, I thought that I had not connected or changed something, which is why it does not work. To test this theory, I copied the code from one of the scenes where it worked, and it worked! I decided to just use this code as a kind of "framework", removed unnecessary functions and objects. And it stopped working!!!

As I found out empirically, timer.performwithdelay() for some reason skipped the delay and immediately proceeded to execute the function IF it was with "parentheses", that is, it worked only in this form: timer.performWithDelay( 1000, function )

I do not know why it works like this somewhere, but somewhere like this, if you can help, then I will be very grateful :)

(And by the way, yes, yes, I know about local functions, but they take up more space than I would like)

Upvotes: 0

Views: 21

Answers (0)

Related Questions