- This topic has 15 replies, 3 voices, and was last updated 1 year, 6 months ago by tg.
-
AuthorPosts
-
2023-05-10 at 9:10 am #63631MariuszCustomer
Hi! I have a procedure that changes the cameras (and will do a few other things soon) to receive an effect of an animated intro screen. I would like that procedure to repeat infinitely (so restart each time after it’s finished). Is there a simple way to do that?
Attachments:
You must be logged in to view attached files.2023-05-10 at 9:46 am #63635kdvParticipantCall the
play_animation_ferry
procedure after the last tweening.Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-05-10 at 10:07 am #63640MariuszCustomerSo obvious, thank you! ;)
2023-05-10 at 11:19 am #63642MariuszCustomerOk, and here’s another question. I need to stop this procedure completely with a button click. How this can be done?
2023-05-10 at 11:47 am #63645kdvParticipantUse some variable to control the loop
When needed set this variable to
false
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-05-10 at 12:53 pm #63647MariuszCustomerThat seems like a fine solution in some cases, thank you. But how can I stop the procedure completely, in the middle of it? In the middle of this “animation”, whenever the user clicks the button?
2023-05-10 at 1:12 pm #63648kdvParticipantCheck the variable state before every tweening. You are free to use conditions anywhere.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-05-10 at 1:37 pm #63649MariuszCustomerThat would be a lot of logic puzzles, especially for more complicated procedures… Isn’t there any other solution for stopping/pausing the procedure?
2023-05-11 at 2:08 am #63660kdvParticipantSo what? Adding several timers is normal but adding several conditions is already a problem?
especially for more complicated procedures
You will be surprised how often
if
is used in complicated functionsIsn’t there any other solution for stopping/pausing the procedure?
Such a magic puzzle/command doesn’t exist. In your case (when using timeouts) the only thing you can do to interrupt the loop is checking if this or that step is allowed before it will be executed.
Wrong
Correct
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-05-11 at 6:42 am #63671MariuszCustomerI simply expected that it might be some more elegant and pure solution for this. But ok, maybe it will appear in the future. ;) Thank you for your help, it worked anyway!
2023-05-11 at 8:39 am #63674tgParticipant2023-05-11 at 8:54 am #63679tgParticipant2023-05-11 at 9:05 am #636832023-05-11 at 9:06 am #63685tgParticipant2023-05-11 at 9:08 am #63688tgParticipant -
AuthorPosts
- You must be logged in to reply to this topic.