Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find child gameobject?

I want to say somethings like..

Gameobject.find(child gameobject of specific parent Gameobject)

Can anyone help me. thanks!


1 Answers

GameObject.Find will search for a gameobject in the scene. To search a gameobject from a parent, use Transform.

There are 2 ways of doing it:

  1. transform.Find("childname")
  2. transform.FindChild("childname")

The 2nd option is deprecated but still functional, so you'd better use the 1st option.

like image 72
Jay Kazama Avatar answered Sep 05 '25 15:09

Jay Kazama