Announcement

Collapse
No announcement yet.

Infinite loop detected

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Infinite loop detected

    Hai! This seems to be a problem a lot of people have, but none of the solutions I looked at seemed to help. Pics below of blueprints. Basically, I am wanting a loop to run until a mouse button is pressed, and this seems to trigger an infinite loop. am I simply exceeding the number of iterations the game thinks are appropriate? If I false the while loop, it exits properly and program continues. If I add the mouse button press detection, it crashes and returns infinite loop.

    Attached Files

    #2
    This is a bad design. What happens is that at every tick, the while loop is executed and since the conditional variable is not set in the body, an infinite cycle happens.

    If you need to update the location until something happen, use a Timer, a Timeline, the Tick function, ...
    Last edited by EvilCleric; 06-09-2020, 11:14 AM.
    "I have harnessed the shadows that stride from world to world to sow death and madness."

    Comment


      #3
      To use a timer, do you put it *in the while loop*? Because I tried that and it still returned an infinite loop. If I start stacking things for detection in the event tick, won't that cause performance drag?

      Comment


        #4
        Your edit perfectly explained what I was missing. Thanks so much!

        Comment


          #5
          There is nothing wrong in using Tick. The problem is when people start doing a lot of expensive operations every tick. The cost of something as simple as a branch and some transforms operations is virtually negligible.
          "I have harnessed the shadows that stride from world to world to sow death and madness."

          Comment


            #6
            This is what I changed it to. Not totally finished, gotta set it to only run the operation if there is something in the variable, but this works without the loop, just with "null variable" errors.
            Attached Files

            Comment

            Working...
            X