We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How Do I Create a Loop Which Iterates Every Second.

Home Forums Puzzles How Do I Create a Loop Which Iterates Every Second.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #47286
    grimmy
    Customer

    I tried creating a loop and adding a ‘continue next iteration; within an ‘after 1 second’ statement but it seems the continue statement doesn’t work this way. Any ideas?

    Cheers

    #47312

    you might use this puzzle that basically wraps JavaScript’s setInterval method https://www.soft8soft.com/docs/manual/en/puzzles/Time.html#every

    Chief 3D Verger | LinkedIn | Twitter

    #47343
    grimmy
    Customer

    I tried using that in a loop but it didnt seem to work. I get an error when I put the ‘continue to next iteration’ puzzle inside the every x seconds puzles (which in turn is inside the loop.)

    #47556
    grimmy
    Customer

    For example..this gives me the error: Uncaught SyntaxError: Illegal continue statement: no surrounding iteration statement

    Same if I use the ‘every’ puzzle.

    Attachments:
    You must be logged in to view attached files.
    #47717
    grimmy
    Customer

    Any word on this? :scratch:

    #47761

    Can you share the project with this piece, difficult to understand what you try to achieve with only few puzzles on screenshot.

    Co-founder and lead graphics specialist at Soft8Soft.

    #47777
    xeon
    Customer

    Without knowing exactly what you are trying to do I can only give you generic advice.

    Some basic testing will show that the loop approach you have taken will not work.

    Create a basic scene with two objects. I chose an icosphere and a cube.

    Using the logic with a timer inside a loop will not work as you might think. The after 1 second…means that after 1 second…you will continue to next itteration. That means after 1.1 seconds..it will automatically continue but before 1 second it will hold and wait.
    The timer is NOT unique to the iteration but unique to the project as a whole.

    You might be more successful using a set timer with an interval of 1 second and a repeat of 3.

    There are other approaches depending on the memory requirements of the loop and lots of testing to validate if you should execute the loop or if the prior loop is done before firing the next. All of that is dependent on your project.

    Attachments:
    You must be logged in to view attached files.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.