hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Loop Break (exit out of loop before completed)

    Scheduled Pinned Locked Moved Comments & Feedback
    5 Posts 3 Posters 616 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • KamdroidK Offline
      Kamdroid
      last edited by Kamdroid

      Add a way to finish/break out of a Loop before it fully completes, like in normal programming.

      string[] stuff = {"bottle","pie","iPad"};
      for(int i = 0; i < stuff.length; i++)
      {
          if(stuff[i] == "pie")
              break;
      }
      
      Aidan_FireA 1 Reply Last reply Reply Quote 0
      • Aidan_FireA Offline
        Aidan_Fire @Kamdroid
        last edited by

        @Kamdroid Behaviour Off the loop. Then if you still wanna use it, Behaviour On it again the next frame (just connected directly underneath the Off). Maybe an even better idea than just Break Loop behaviour: a Restart or Stop Behaviour behaviour, stops everything the behaviour selected was doing. But if Behaviour Off and then On pretty much does this, this would only cut down 2 behaviours when stopping behaviours.

        KamdroidK T 2 Replies Last reply Reply Quote 0
        • KamdroidK Offline
          Kamdroid @Aidan_Fire
          last edited by

          @Aidan-Oxley Oh, you're right. I totally forgot about trying behaviour off. Thanks.

          1 Reply Last reply Reply Quote 0
          • T Offline
            Thecheater887 @Aidan_Fire
            last edited by

            @Aidan-Oxley Doesn’t behavior on execute it?

            Aidan_FireA 1 Reply Last reply Reply Quote 0
            • Aidan_FireA Offline
              Aidan_Fire @Thecheater887
              last edited by

              @Thecheater887 Not if the loop is connected underneath another behaviour, and the Begavior On has Skip Events turned off.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post