I am unable to hide a 3D character using renderer.enabled=false;
function Start () {
GameObject.Find("Female_v01").renderer.enabled=false;
}
This is the error msg I get
MissingComponentException: There is no ‘Renderer’ attached to the “Female_v01” game object, but a script is trying to access it.
You probably need to add a Renderer to the game object “Female_v01”. Or your script needs to check if the component is attached before using it.
How do I add a renderer to the character? The character is being rendered though.
I am able to translate, rotate the character etc using the above GameObject.Find
When you bring a character in from a 3d app (like maya for instance) everything in the scene is grouped under one gameobject in unity, but opening the heirarchy of that object will reveal all of its child objects, such as your bones and the actual geometry of your character.
My guess is your file is named Female_v01, but your actual geometry (the thing that actual has a renderer) is something else entirely. Your script should be searching for that instead.