Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Volume Spot GO layer - set children
#7
Hi, sorry I neglected to check back in here. I actually implemented something very similar at the code location you stated.

childCount only counts the immediate children of the parent, though, so that will work fine as long as the hierarchy isn't too complex. I added this instead, and it seems to work without any obvious issues:

Code:
Transform[] ts = res.GetComponentsInChildren<Transform>(true);
foreach (Transform t in ts)
     t.gameObject.layer = Layer;

I'm presuming GetChild and GetComponentsInChildren don't differ too much in terms of performance.

Thanks for getting back to me!
Reply


Messages In This Thread
RE: Volume Spot GO layer - set children - by leeharris - 08-05-2021, 04:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace deform mesh on volume spots Kokoriko49 1 2,241 06-09-2025, 06:49 PM
Last Post: _Aka_
Photo Volume Spots problem with spacing Bond007 3 2,444 01-20-2025, 12:27 PM
Last Post: _Aka_
  Duplicate Volume references become null joebain 5 3,078 11-18-2024, 10:46 AM
Last Post: joebain
  Nested Spline Volume Spot Instantiation merobbins5 3 2,735 07-26-2024, 09:58 AM
Last Post: _Aka_

Forum Jump: