Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

there is no renderer attached to the gameobject

//renderer is attached to meshes inside gameobject
//pass true in order to also include disabled or inactive child Renderer
foreach(var rend in GetComponentsInChildren<Renderer>(true))
    rend.material.color = Color.red;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #renderer #attached #gameobject
ADD COMMENT
Topic
Name
3+4 =