- Home /
Question by
johnkevin18 · May 18, 2018 at 02:30 PM ·
gameobjectspriterendererchildren
how to control spriterRenderer in childrens
Hello! I have a doubt, I would like to know how to control all spriters renderes that are children of a gameobject, in my project the player has a spriteRenderer for each part of the body, one for the head, one for the body, and more for the arms and legs ... I would like to control them, to be able to for example: make them all turn blue to indicate that the character is slow, or red when it takes damage. Does anyone know a solution?
Comment
Best Answer
Answer by Oliver1135 · May 18, 2018 at 02:37 PM
What have you tried, using someGameObject.GetComponentsInChildren<SpriteRenderer>()
in your parent game object should get you the sprite renderers in your child gameObjects. then you should be able to manipulate them as you need to