(if anything, this post has been translated through a translator from Russian into English)
For me to game, 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)
Chagil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.