- Home /
Animations from blender going super weird
Hi, So I've made a robot character for a third person game in blender - I've only made 2 animations so far, an idle animation and a run animation. They both look fine in blender. Here's the problem - whether I import my robot into unity as a .blend file or a .fbx file, there's some terrible problem which doesn't exist in the other one. It's really annoying. Like, there's no way around it, something goes wrong no matter how i import it.
If I export my blender file as an fbx: When I import it into unity, the animations are totally messed up. Basically, the run animation looks fine, but the idle animation is sortof... a combination of the two. The upper body does the idle animation - you can see the robot breathing and his scarf blowing in the wind, but his legs are frozen mid step from the run animation. He's sort of floating with his legs stuck on one frame (not the first frame, like a random one in the middle somewhere) of the run animation, while the rest of him is just standing still breathing calmly, with his arms by his sides. It's hilarious. but really annoying. This happens both in the preview window thing and in game if i try to get him to do this animation.
If I import my blender file directly: I don't know why this happens, but somehow the idle animation is like... changed slightly. For this animation he breaths in, out, in, out. Then it repeats. What's weird is that when he's about half way through each breath, he suddenly shakes, really weirdly. just slightly, but you can see his head go back, the forward, then back really quickly, like a jack in the box that's been punched in the face. only far less extreme, and much faster. what's even weirder is that it doesn't happen the first time he breathes in. only when he breathes out and the second time he breathes in. I've gone back to blender to have a look and it's definitely not happening there.
I think the strangest thing about all of this is that I can fix both of these problems by importing my mesh in the other format - it's just so annoying that no matter how I import it, one of these things happens.
Here's some possibly useful information: -blender 2.71 -unity 4.3 free version -importing armature type as "generic" -mesh has no single root bone - there are three root bones. i thought that might be the cause of the fbx problem, so i made a single root bone and set it as the parent of the other three, but it didn't solve anything. -I'm using the NLA editor thing in blender -animation compression is off in the import settings
Usually when I have a problem it's because i've done a stupid, but i can't think why this would happen... This has got to be one of the weirdest issues i've ever run into making a game, it kinda feels like there's a problem with one of the two programs or something. I dunno, maybe not. But yeah, thanks for reading all this. If it'd help, i can send you a copy of the .blend/.fbx/.unitypackage or whatever of this stuff, just ask
Thanks,
James
Have you checked your animation transition and clamp times?
yeah, i tried all this with the clamp times i used in blender, and with the animations looped so i didn't really need transitions in the animator controller
Do you have animation keyframes for all your bones in all the animations?
yup. at the begining of each animation i have a keyframe for the rotation and location of every bone
Answer by meat5000 · Apr 12, 2015 at 04:15 PM
In Blender,
Go to NLA Editor. Delete all entries. (Highlight them in the NLA editor and press X on the keyboard).
Go to Dope Sheet.
Use secondary dropdown to select Action editor.
Select the rig and highlight all bones. Make sure you are in Pose Mode. Select Idle animation and go to NLA editor to see a new track has been made. Go back to Dope sheet and do the same for Run.
Go back to Object mode.
Save and Export as FBX.
During export Select Armature, Mesh and Other boxes (using Shift-key), change 'Forward' from -Z to Z, Deselect Leaf Bones.
Export.
Did that actually work when you imported it into unity? I tried it and it was even worse... Now the Idle animation has the run animation's arms as well as the legs, only the scarf and the breathing are what they're meant to be. When you say highlight all bones, you mean select all bones in pose mode, right? And when you say save and export you mean save and export as fbx? That's weird if that worked when you tried it, maybe we have different versions of unity or blender or something... Did you see what the problem was with the fbx one in the unitypackage I uploaded?
It did work for me, yes.
See for yourself
https://www.dropbox.com/s/hw665bx6bbs8vo4/Robot2.fbx?dl=0
The trouble is that there are unnecessary linked 'users' of the animation. For Unity, Blender Animations should be linked through the Action editor. It appears you had done this and also linked it through NLA editor.
Oh wow... Now this is very strange... I tried it again, but this time I clicked the little button that just says "F" on it by the animations... I clicked that for the run and the idle animation, and this time the idle animation was fine, and it was the run animation that was weirded... It was all idle except the scarf which was running...
What version of blender do you have? Can you send me the fbx you exported so I can see if it works with my version of unity? The only thing I can think of that we could be doing differently is that we could have different versions of programs.........
Linked it 26 $$anonymous$$utes ago :D
I'm on 2.73. There wont be much difference.
When it is correct the animations will appear in Unity like so
Armature|Idle
Armature|Run
The F button forces a fake-user. This links the datablock to the active object. When it is correct there will be a 2 next to the F, not a 3.
When you see 3 it is linked to another object, which will usually cause you problems like weird rotations and translations.