function Awake () {
DontDestroyOnLoad (transform.gameObject);
var childs = gameObject.GetComponentsInChildren (GameObject or Transform);
for (x in childs){
DontDestroyOnLoad (x.renderer.mesh);
}
DontDestroyOnLoad(transform.Find("Bip01_Pelvis").gameObject.mesh);
}
Then, I think I did everything what I can.
But error code says .mesh is not member of gameobject.
So how can I preserve .mesh when go to another scene?
…and you do not need to use DontDestroyOnLoad with every component. Simply write DontDestroyOnLoad(this) and this should work with the entire gameObject your script is attached to.
You need to call the DontDestroyOnLoad() method on the mesh. To get a reference for the mesh you need to find the MeshFilter component and use the mesh property on it.