Playmaker Forum

PlayMaker News => General Discussion => Topic started by: kentcheung2000 on December 15, 2018, 02:02:43 PM

Title: Is there a loop action?
Post by: kentcheung2000 on December 15, 2018, 02:02:43 PM
Hi,

Is there a loop action in playmaker?  I type loop in the latest playmaker, but I can't find one..

KC
Title: Re: Is there a loop action?
Post by: Thore on December 15, 2018, 02:08:24 PM
What would this action do, exactly? You can create program loops (foreach type) easily by simply connecting events in a circular manner, and each time pick another item from an array for example (by adding +1 to index, as you’d do in code).
Title: Re: Is there a loop action?
Post by: DanielThomas on December 15, 2018, 03:31:17 PM
As Thore said. You can just connect in a circular manner(or even just connect the state back to itself). Just make sure it's done each frame, or if you need it to loop through several times in one frame - make sure there is something taking it out from the loop or you'll get Playmaker error saying it's stuck in an infite loop.
Title: Re: Is there a loop action?
Post by: tcmeric on December 15, 2018, 08:47:55 PM
I also created a custom loop action. You can download it here and see how it works:
Title: Re: Is there a loop action?
Post by: jeanfabre on December 17, 2018, 01:23:35 AM
Hi,

 you have lots of actions to loop, some are name GetNextXXX when they target specific variables, else, use the "Iterate" action from the ecosystem, which is the most generic approach.

you can also keep a int variable and loop using intAdd, intCompare, etc and build the pattern yourself.

Bye,

 Jean