Loop Break (exit out of loop before completed)



  • 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;
    }
    


  • @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.



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



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



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


Log in to reply
 

Looks like your connection to hyperPad Forum was lost, please wait while we try to reconnect.