playMaker

Author Topic: set children renderer on or off recursively  (Read 2162 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
set children renderer on or off recursively
« on: December 12, 2014, 12:19:47 PM »
I have objects, like tanks, that have a number of children.  I want it to stay active so the whole thing is invisible.  The problem is each part has a renderer.  It would be nice to set the renderer off recursively.  Something like unity's "GetcomponentsInChildren".
==============================================

for(var r : Renderer in GetComponentsInChildren(Renderer))
{
     r.enabled = false;
}

===============================================
I did find something similar for materials but not renderers.
http://hutonggames.com/playmakerforum/index.php?topic=1053.0
===============================================
I did find this but in his post he says 'set visibility' has a recursive option, but I do not see it.
http://hutonggames.com/playmakerforum/index.php?topic=159.0