- Home /
How to disable animated model child mesh renderer?
I downloaded a model from the Asset Store, I have it animating, but after a certain point I want to stop rendering the model and play it's particle effect (an explosion).
The Skinned Mesh Renderer is a child of the parent GameObject.
How do I access that child skinned mesh at runtime to disable its renderer without disabling the particle effect.
If i simply use renderer.enabled = false, the model is still renderer but the particle effect doesn't render.
Comment
Answer by whydoidoit · Nov 25, 2012 at 10:13 PM
//JS
GetComponentInChildren(SkinnedMeshRenderer).enabled = false;
//C#
GetComponentInChildren<SkinnedMeshRenderer>().enabled = false;