Hi,
I’m struggling to get a loaded mesh to animate at runtime. Here’s what I’m working with:
- FBX File: Contains a skeleton, mesh, avatar, animator, and skinned mesh rendererer
- Multiple Meshes (stored as asset files)
- A custom component called “Character Model”, which contains an animator, skinned mesh renderer, and a skeleton (the skeleton GameObject is a parent to the root joint).
I have stored the FBX’s skeleton as a prefab, so I can instantiate it at runtime for multiple poses, based on the game’s requirements. I have also prefabbed my Character Model component, so I can render multiple meshes.
For the FBX, the rig has a Humanoid animation type (even though it’s coming in as generic - I overwrite this), the avatar definition is “Create From This Model”, and when I configure the avatar definition, I simply select “Automap”. For the animation, the animation type is also Humanoid, the avatar definition is “Copy From Another Avatar”, and the source is the FBX’s avatar.
My steps to animate a mesh are:
- Instantiate a new Character Model
- Instantiate a new Skeleton
- Load a mesh
- Update the Character Model’s Skinned Mesh Renderer with the root joint of the skeleton (I make sure the GameObject is named “root_JNT” - this is required by our animations), and the loaded mesh
What I end up getting is a character in the T-Pose, subtly animating the root joint. The animation I’m providing is an idle animation, and has the character rotating (slightly) about the y-axis. It also has his hands by his side (instead of in the T-Pose).
So, any ideas as to what I’m doing wrong, and my I can’t pose my custom meshes? This is difficult to debug, and I’m not quite sure where to start? Do I have a bone weighting issues? Are my bind poses off?
Any tips/suggestions would be greatly appreciated.
Thanks!
Brennan