- Home /
Non-humanoid Rig Gets Mangled in Mecanim
I'm trying to animate a cat model for my game and I'm having some issues. First off, my spine seems to be extremely twisted in Unity, but it's not twisted in Blender. Here's what that looks like:
Also, it plays my idle animation, but it doesn't seem to want to play my walk cycle. It seems as though the state machine doesn't recognize that my script is setting the speed parameter
void Update () {
if (isCat == true)
{
speed = 10.0f;
}
else
{
speed = 5.831f;
}
// WASD forward/back & left/right movement is stored in "direction"
direction = transform.rotation * new Vector3( Input.GetAxis("Horizontal") , 0, Input.GetAxis("Vertical") );
// This ensures that we don't move faster going diagonally
if(direction.magnitude > 1f) {
direction = direction.normalized;
}
Debug.Log("isCat? " + isCat + " speed: " + speed);
anim.SetFloat("CatSpeed", speed);
}
I'm doing something a little weird in this case, because my game switches between a cat and mouse model. I've got the meshes for the cat and mouse set as children of an empty game object and I switch between them according to actions the player might take in the course of the game. I wonder if this is an issue when playing animations. My animator is set on the parent gameobject and I have the correct avatar set there. I'm not currently animating the mouse gameobject, only the cat. I'm guessing that because the idle animation is playing, that's not an issue, but I wanted to ask to make sure.
Here's an image of my animator state machine
I am importing the rig as a Generic rig and I've got the root node set properly (I think). I'm not sure how to see what the root node is in Blender, so if anyone could give me a hint there, it'd be appreciated. The first bone I created is currently set as the root node, but I'd still like to explicitly make sure there's no issues in Blender.
Your answer
Follow this Question
Related Questions
Is retargeting available for generic rigs? 1 Answer
Mecanim problem 1 Answer
Generic rig creates sliding feet? 0 Answers
Mecanim: Importing raw rigs with no mesh and only animation data? 0 Answers