Created
April 21, 2020 14:10
-
-
Save openroomxyz/649c7308577ee8fb24a41104cd3e8b5e to your computer and use it in GitHub Desktop.
Unity : How to find a children by name of current gameObject and change it’s color?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MeshRenderer topMeshRenerer = transform.Find("Top").GetComponent<MeshRenderer>(); | |
| topMeshRenerer.material.color = color; | |
| //Note : Children children, not children of children’s. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment