Hi everyone, I have a script that allows me to change the meshes of my character into different meshes. Could that possibly affect how they’re rigged in mecanim since the script does change what they originally were? Here is the script and line number 16 is what changes them.
using UnityEngine;
using System.Collections;
public class ExampleScript : MonoBehaviour{
public Transform[] someTransformArray1;
public Transform[] someTransformArray2;
void Awake(){
if(someTransformArray1 != null someTransformArray2 != null)
foreach (Transform child1 in someTransformArray1)
foreach (Transform child2 in someTransformArray2)
if(child1 != null child2 != null)
foreach (Transform subchild1 in child1)
foreach (Transform subchild2 in child2)
if(subchild1 != null subchild2 != null)
if(subchild1.GetComponent<MeshFilter>() != null subchild2.GetComponent<MeshFilter>() != null)
subchild1.GetComponent<MeshFilter>().sharedMesh = subchild2.GetComponent<MeshFilter>().sharedMesh;
}
}