playMaker

Author Topic: Get Next Child Or Set Parent Not Working Properly  (Read 1603 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Get Next Child Or Set Parent Not Working Properly
« on: October 15, 2018, 11:28:56 AM »
I've got a simple FSM consisting of:

1. Get next child, store it under 'child'.
2. Set parent of 'child' to none.

Repeat until all children are detached.

But, of 7 objects i have childred, not all are being detached. Any ideas? Seems like a bug.

Good old dumb find child/set parent to none works, this somehow fails.

Unity 2018.3b5
« Last Edit: October 15, 2018, 12:25:04 PM by krmko »
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Next Child Or Set Parent Not Working Properly
« Reply #1 on: October 16, 2018, 03:28:45 AM »
Hi,

 can you share the fsm in question, I'll try to repro.

 Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Get Next Child Or Set Parent Not Working Properly
« Reply #2 on: October 17, 2018, 09:12:42 AM »
Sure, i'll make a package and send it.

Cheers
Available for Playmaker work

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Get Next Child Or Set Parent Not Working Properly
« Reply #3 on: October 17, 2018, 09:08:04 PM »
I can reproduce, I assume when you unparent the child it messes with the index so when it loops back to get next child it ends up skipping some

Workaround can be to add them all to an array list and then unparent from that

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Next Child Or Set Parent Not Working Properly
« Reply #4 on: October 18, 2018, 02:03:14 AM »
Hi,

 ah yes... if you are looping through the childs, but during the loop you unparent the child, then it messes up the iteration for sure...

Bye,

 Jean