playMaker

Author Topic: Get Next Child and Move To issues...  (Read 2650 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Get Next Child and Move To issues...
« on: June 27, 2012, 09:46:26 PM »
So, i have the "get next child" action running in concert with the "move to" action and it works on the first run through, but on the second one, it's not moving to the second point i need it to and the moveTo action is stalling out, not finishing as i have defined it to do so.

the finish distance is set to one unit...

i've run the test and the "get next child" action is working fine (it's cycling through though not in the proper order that i'm telling it to but i can work around that one... i'm going to hazzard a guess that that action is based on the order created and not the order in the heirarchy window) but still, the moveTo isn't clicking into action...

when i turn off the "smooth look at" that's also in there, it's working... but not when i have it on.

i can provide a template if needed for testing.

EDIT: so... turning off the "smooth look at" only cycles through two of the four points (they're waypoints) and exiting the system... is this possibly a bug with get next child? i'll try wiring it directly up to four separate states to test further.

EDIT:: yep, four separate states with four hard-coded in waypoints works fine... so, it's looking like "get next child" is causing some issues.

EDIT::: And confirmed that it's picking in the order of creation, not order in the heirarchy.

EDIT:::: also confirmed that this issue is happening with the iTween Move to action as well.

I've put in a "next frame event" between when i tell the Get Next Child action to cycle and then move towards... so i think there's a timing issue in there... so, that's a workaround but just a head's up that there could be something iffy about the "get next child" action.
« Last Edit: June 27, 2012, 10:08:18 PM by Red »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Next Child and Move To issues...
« Reply #1 on: June 28, 2012, 01:23:13 AM »
Hi,

 the get next child cycle through the child list returned by Unity so, I am not sure how it's sorted, but it should not make any difference in what order you are processing them.

I am not sure how you actually "tell it" to go to a particular child, it does that automatically.

Can you debug the flow of events and see what's happening, it will certainly help you find out where things do not get processed the way you expect.

Could you share that, I am sure we'll find the problem.

 bye,

 Jean

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Get Next Child and Move To issues...
« Reply #2 on: June 28, 2012, 12:42:58 PM »
well, for starters, i've been able to troubleshoot that the initial issue is a timing one since it's not being given enough time to fire off the appropriate actions. the next frame has addressed that as that seems to be more a stop gap. it isn't "move to" that has the issue in it per-se... as that works as expected... it's when it's interacting with Get Next Child that the issue came up. on it's own, Get Next Child does seem to do what it's told but still it seems that it's actions take a bit more time than i had thought they would.

the issue with the order in which it collects the children to cycle through is still a mystery to me though... if i were a coder, i'd probably look into the code of the action but that's mostly greek to me (i understand maybe 1/100th of it.)

i'm not sure if this is something because of how unity handles the item gathering or if this is playmaker (or even Monodevelop.) so, anything past an initial use of the action and how to refine it so that it will function at the very least is going to be beyond me.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Next Child and Move To issues...
« Reply #3 on: July 02, 2012, 02:12:35 AM »
Hi,

 found an interesting comment on this and it might what you are experiencing:

http://unity3d.qatohost.com/questions/254498/index-order-of-getchild.html?sort=oldest

So, if you want to maintain order and control it, I would suggest to use ArrayMaker and store your childs in an array or hashtable, then it would be stable and you could then iterate them in the same order over and over again.

 Bye

Jean