playMaker

Author Topic: parent has index child X?  (Read 1683 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
parent has index child X?
« on: September 19, 2016, 06:24:41 AM »
for cycling through all the children and doing things to them.

parent has child index 0? then do action
parent has child index 10? no? then end this series of events.

as far as I know, we currently have "get child at index X" but not a check to see IF the parent has that child. optionally, add an "if fail" case to that older action.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: parent has index child X?
« Reply #1 on: September 19, 2016, 12:14:32 PM »
Hi,
Maybe you could use "get next child" instead?

If not, what you can do is "get child count" and do an "int add" -1
The result = the highest index nr