playMaker

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

kentcheung2000

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Is there a loop action?
« on: December 15, 2018, 12: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

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Re: Is there a loop action?
« Reply #1 on: December 15, 2018, 12: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: 109
    • View Profile
Re: Is there a loop action?
« Reply #2 on: December 15, 2018, 01: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: 693
    • View Profile
Re: Is there a loop action?
« Reply #3 on: December 15, 2018, 06:47:55 PM »
I also created a custom loop action. You can download it here and see how it works: https://www.youtube.com/watch?v=935OiYj1uU8

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14059
  • Official Playmaker Support
    • View Profile
Re: Is there a loop action?
« Reply #4 on: December 16, 2018, 11:23:35 PM »
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