PlayMaker Updates & Downloads > Official Action Updates

Get Next Child

(1/2) > >>

Alex Chouls:
Currently to loop through all the children of a GameObject you have to use Get Child Count, Get Child Num, Int Add, and Int Compare  - which is a bit of a pain!

Get Next Child does this all in one action.

See the attached screenshot for usage. You can replace the Debug action with any action you want to perform on all children of the GameObject.

jeanfabre:
Hi,

 Interesting, could you explain the process, I  don't really understand how that works.

-- Will it not hit the infinite loop warning this way? I do that too, but to prevent the infinite loop, I set th eevent with 0.00001 delay.

-- does that mean that when a transition is pointing to its own state, the action is not reinstanciated and therefore all variables values are still there, and onEnter is called again.

 That's excellent! Ill experiment with this.

Bye,

 Jean

qholmes:
Yes i looked at this and it has possibilities..

Could the Set Color with children that Jean did the other day be done with this type of code?

Q

jeanfabre:
Hi,

 yes it would actually, tho saving the original color would be then difficult without a custom action anyway.

 Bye,

 Jean

qholmes:
Right.. i see what you mean by saving the original color..

I 3/4 built the change color with children Action but then lost my direction on it and decided i did not have time to figure out the last bit of it.. But my approach was to save the original in an array before changing them. I assume you did the same sort of thing. I have not looked at your script yet.

You are seriously the script master Jean.. I wish i had your skills. And you are very generous.. Thank you!

Q

Navigation

[0] Message Index

[#] Next page

Go to full version