playMaker

Author Topic: More advanced GetNextChild  (Read 1797 times)

QFGlenn

  • Playmaker Newbie
  • *
  • Posts: 30
More advanced GetNextChild
« on: October 24, 2015, 03:12:33 PM »
Hi, I was hoping to use FindNextGameObject where it would store the Child it is presently at as a seperate variable, and then cycle next game object and store that as a variable.

Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: More advanced GetNextChild
« Reply #1 on: November 09, 2015, 07:39:35 AM »
Hi,

 To do this, simply use the following technic.

 Have two variables, "CurrentChild", and "PreviousChild"

-- use "CurrentChild" that is used within the GetNextChild, this one will represent the current child being iterated,
-- after you've process it, just before looping back to GetNextchild, save CurrentChild in "PreviousChild", and then on the next loop, you'll be able to work with both the current and the previous.

would that work? else can you explain what you want to achieve? cause I can't see why you would need two variables inside this action.

 else, you may want to simply maintain an int as a reference to a given child, and then you can use simple math to get to a relative sibling.

 Bye,

 Jean