top of page

Get all the Children in Transform even if the Children are inactive

  • thetperson314
  • Apr 13, 2023
  • 1 min read

Updated: Apr 29, 2023

When using


GetComponentsInChildren<Transfrom>()

You get the transform children but only the child objects that are currently active in the the hierarchy, but what if we want to get the inactive ones too? Most developers I know, are getting all of the objects on the start of the scene and disabling the object they want to be inactive.


but there is no need for it!


To get component of the inactive objects too you can just use



GetComponentsInChildren<Transfrom>(true)

And that's it, pretty easy right?


If you find this useful, there are 2 other things you can do like this, but as a YouTuber (😜) I have to send you to

and to My Patreon page for the second one (it's a free post)


 
 

Recent Posts

See All

FAVORITES

Try playing Core Keeper and learn from it's sound design!

From the sound effect to the music - this is a masterpiece!

WHAT'S NEW?

New game on Steam and a new mobile video asset are soon to be published!!

I AM THINKING ABOUT

AI is on the rise. Being able to use it in the right cases and explaining the task correctly is no easy task but once you finish a full task without writing a line of code - your world will change!

CONTACT ME

Use any social media to contact me. For any question about programing and project I prefer using my Discord server, See you there!

© 2021 by Amit Klein. Nerd Head.

bottom of page