playMaker

Author Topic: Is there a loop action?  (Read 1807 times)

kentcheung2000

  • Playmaker Newbie
  • *
  • Posts: 37
Is there a loop action?
« 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

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Is there a loop action?
« Reply #1 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).

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Is there a loop action?
« Reply #2 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.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Is there a loop action?
« Reply #3 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:

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Is there a loop action?
« Reply #4 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