Hi guys i’ve got a little problem with SkinnedMeshRenderer and animations, i’m going to explain it better ( sorry for my english ) . What i’m trying to do is a character which can change its meshes runtime but it should also animate.
My character hierarchy is something like that :
-Character
…- Skeleton
…-SharedBiped ( SharedBiped is a human skeleton )
…- ArmorSet1
…- ArmorSet2
…- Head
…- Hands
ArmorSet1 2 are two other object structured like this :
-ArmorSet1
…-Biped ( this is the skeleton i used to rig/skin the meshes in a 3d editor)
…-Mesh1
…-Mesh2
…
I wrote a script which edit each SkinnedMeshRenderer attached to every single Mesh in the ArmorSet. Through script I edit the bones array and I change each bone with the corresponding belonged to SharedBiped.
It works , i mean , through script i’m able to change mesh runtime and rotate a bone so that meshes follow this bone , but there is a problem, when i try to import , and play runtime an animation. I tryed to make a script so that the animation could start as soon as I press a button , but nothing seemed to happen , so i tryed to attach 2 two cubes to the legs bones, and I noticed that when I started the animation those 2 cubes started to move following the bones.
My question is why would this happen , i mean , why meshes moves only if i move bones through scripting and don’t move through animation ?
Thanks in advance