Hi,
I have a problem on activating skinned mesh renderer via script.
In my script is a line which switches the mesh renderer and plays animation:
secClickedObjectGC.gameObject.renderer.enabled = true;
var getAnim : Animation = ClickedObjectGC.gameObject.GetComponent(Animation);
if (getAnim){
getAnim.enabled = true;
getAnim.animation.Play();
}
it works fine for transform animations. But when it comes to bones and skinned mesh renderer, it fails.
My hierarchy of objects I want to toggle looks like this:
o emptyGameObject
o Bone001
o rope 01
o Bone002
o rope 02
I draged a MeshRenderer on emptyGameObject and hoped, that when I turn on MeshRenderer, the skinnedMeshRenderer in rope01 and MeshRenderer in rope 01 will be enabled too, since thy are children of emptyGameObject. But this doesn't happen. Any advice?
↧