[Solved for now] Animation errors from blender to Unity

Hi everyone,

I'm a newbie and I want to learn as much as possible. I've been working on a problem all day long but I haven't found the solution so I ask your help wishing to figure out how to solve it.

I created a model in Blender 2.49b with an animation. It is a very simple model: alt Model in starting position alt Model in ending position

The first is in the starting position and the second is the ending one: So Blender shows what I want.

When I import it in Unity its behaviour is completely different...

Here are some screenshots of how the animation works in Unity: alt Starting position in Unity alt Middle position in Unity alt Ending position in Unity

Other informations that can be useful maybe are these: The starting position of the mesh (with no armature and modifications introduced it) is like the one in the first image but with the arms aligned with the X (red) axis (the cannons are perfectly alinged and overlayed on the X axis to be more precise). In the first frame of the animation the arms have 70 of difference from the X axis rotating from the front view and other 20 of difference from the Z axis rotating from the side view (I've just rotated down the arms and a little bit forward).

When I export I just copy the .blend file in my "Models" folder and leave to Unity all the operations. I think it uses the standard settings used by Blender to convert the whole in .fbx which are:

alt Standard settings for fbx export

Thanks to everyone who will help me. The problem is very important to me because I've spent something like 80 hours (at least, and I'm not joking) in training and gaining the knowledge to create this videogame. My target is to expose my work as an exam project and I'm working very hard to create something valuable and I don't want to stop for a problem like this one.

Thanks and regards, BlackGecko.

EDIT after Mike's answer

Here is my solution but I really don't know why it worked:

  • First of all I rigged the mesh in the way Noah's told me so no bones out of the mesh. In the first picture a central bone goes backwards and out of the mesh. The purpose of that bone was to translate every bone just moving that bone. It is what I call the master bone but it is just my way of naming that bone, considering that I know very little of 3D modeling terminology. I moved the master bone inside the mesh in the direction -Z (note for newbies like me who will find this page in an agony moment: -Z means "aligned with the Z axis but in the opposite direction" so in this case the bone points down). Anyway I didn't test if this rule is really necessary and there are some things that made me think. Notice that my model has no arms, like Rayman, so the bones I made still go out of the mesh. Anyway I would always try to keep the bones inside the mesh.

  • I simplified my animation moving the arms just in one direction (this is another thing that make me think that probably the problem is not completely solved).

  • I exported using Blender and not imported using Unity.

  • I exported using the following settings: alt Standard settings for fbx export Like the image but Scene Objects, All actions has to be selected (if you select current action you have to select it otherwise a model without animations would be obtained).

  • This is the thing I think solved my problem. I weight painted my model again. This time I painted ALL the vertices because the first time I didn't paint the body's ones.

  • Never lose the calm. It is quite obvious but I passed two hours in the IT lab of my school with my classmate trying to make me angry. At the end of the two hours I obtained just more problems.

Hello.

Ok sometimes when you export from blender to unity, weird things can happen (and i mean really weird) I reccomend you the following steps to get your complete model and animations working perfectly in unity:

1) Rig the model really well (no bones out of the mesh).

2)Put a name to every animation you do.

3)Export in FBX mode (never import the blend files, this tend to have errors).

4)Remember to export scene objects and to enable all animations and images.

5)Practice a lot, sometimes you can forget steps.

6)Have fun.

Good Luck BlackGecko.

I've had similar problems however I'm using 3DS max. I've never touched blender so forgive me if this answer is completely useless.

The way we solved our problem was to change the pivot point in 3DS max until we had it right in Unity. This had to be done for each object on our player and each animation had to be adjusted to animate correctly.

For instance, if you have a helicopter model with top rotor blades (forget the back one for this example) and your model is set up in your software so that the y axis is up and the z value is forward (atleast that's how it worked for me) Then you have to animate the rotor movement AFTER you have adjusted the pivot points and import the animation with local pivots NOT world pivots.

Like I said this is how we solved the problem with our specific model in 3DS max. Hope it helps.

i am having similar problems with my fps Player at the min made in blender, i think most of the time it is due to parenting. well thats how i managed to fix most problems anyway, for example my gun was there in the scene view but not in game so i parented it to the gun bone in unity and it worked.(it shoulda been there anyway, it was in blender)

so i'd check through the parents on your model it must be something to do with the way Armatures work in Blender compared to Unity.