Apply Material to Specific Children
Hello, so I am implementing a power up type of system. I have a material that is just a red color that I want to apply to specific body parts of the player. Specifically these:
In my Awake method I try to get access to the render with this code:
void Awake() {
CharacterController = GetComponent<CharacterController>();
SpotCollider = GetComponent<Collider>();
SpotRender = GetComponent<MeshRenderer>();
}
After this on onTriggerEnter I want to change those components to a red material. I'm not sure how to pick and choose children.
Thanks for your time.
specific-mesh.png
(3.4 kB)
Comment
Your answer
Follow this Question
Related Questions
3D Objects disappear when running the build 0 Answers
Create 3D object from external camera view 0 Answers
Small bug? on ShaderGraph 0 Answers
Apply texture/materials without stretching them according to the surfaces of the 3D structure 0 Answers
How to change the default rendering mode for materials in Unity? 0 Answers