- Home /
Blender animations moves my object
I just started working with Blender and i just made a cube with a animation, it just moves back and forth in one axis basicly. The problem is when i export it to Unity and place it where I want it and add a animation controller to it with my animation the cube moves to Unitys 0, 0, 0 world position. How do I make my animation play wherever i place my object?
On all the tutorials I have watched to try to get an answer to this the person who made the video always puts the object at unitys 0 position but of course you should be able to place it at your desired location?
When i add sample characters that I have downloaded to my scene they animate great and stay at the same position as i put them.
Also: When i scale the object in unity and then hit play the object goes back to its "natural" size.
What is wrong? Something in the export from blender that mess things up?
I use the latest versions of both programs.
Did you try setting the animation mode to Legacy when you select the .fbx. Did you place the object into the scene when you are not in play mode, or move it to the desired location when not in play mode?
It sounds like you are making some kind of simple mistake like that.
When I changed it to Legacy it works actually. The problem is that i only works when it has a parent object? I tried to export only the selected object from blender and then i get a .fbx in unity with the cube and its animation. The problem is that now it doesnt help that i changed it to Legacy, it jumps to 0 and sinks halfway through the plane...
When i export the whole thing from blender including the camera and lamp it works... Without the lamp and camera it doesnt work... Weird...
PS. I do all these things in scene-mode.
O$$anonymous$$ what I mean is that you didn't press the Play arrow button in Unity to start the scene when you try to move it? If you do that none of the move changes will stay. You need to make sure you do all your Unity adjustments in the Editor while the game is not running.
It sounds like you exported the .fbx wrong in Blender and have your cube somehow a child object of the lamp and camera?
In the Export settings there are several boxes highlighted blue in my version of Blender.
Empty, Camera, Lamp, Armature, $$anonymous$$esh.
You want to deselect the ones you don't want to export. Usually the only ones I leave selected are Armature (if it has bones for animations) and $$anonymous$$esh (so you can see it).
I also deselect "Include Default Take" since generally that will just give you a useless animation in most the .fbx I've dealt with.
Also why are you importing a cube as an .fbx you know you can make a cube much easier inside Unity right? And why are you animating a cube?
I'm just kind of confused what you are doing unless this is a test to make real character .fbx models in future?
Nope I do everything in the editor mode, nothing is done while in play-mode.
I´ll try to explain a little better, English is not my first language so it might get confusing :)
First of all, I just made a cube with a simple animation of it going back and forth just t try how it works basicly. $$anonymous$$ind of like a first step to making more complicated models and animations. When i export as .fbx with Empty, Camera, Lamp, Armature, $$anonymous$$esh selected i get those thing in the fbx in Unity. When i drag that fbx into my scene the Hierarchy looks like this:
TestCube
Camera
Cube
Lamp
When i change this fbx to legacy the animation works and the object doesnt go to 0, 0, 0. But when i export only the mesh and the included animation it looks like this in the Hierarchy:
TestCube
and when i press play the cube moves to 0, 0, 0. Even tho I changd it to Legacy.
I hope you get what i mean.
Did you try to export the .fbx with only armature and mesh selected? You don't need the Empty, Lamp, Camera in your .fbx export. That is likely your problem.
Answer by zanearn · Nov 12, 2013 at 02:41 PM
Make a empty GameObject 'G'. Move the cube under G as its child. Move G to the place you want the cube to be. Test the animation again.
Answer by relicright · Nov 20, 2013 at 08:06 PM
Revert to Blender 2.5 or before, this will fix the resetting of the objects position while playing animation until they fix the bug.
Answer by meat5000 · Nov 20, 2013 at 08:11 PM
This is not a Blender Issue.
You can animate 'in-place' or move root within your animation in Blender.
In Unity Legacy animation supports 'in place'. Use a root-motion animation with legacy and the object will snap back at the end.
Using Mecanim root-motion will work correctly, or you can bake positions in the model import animation tab if you want a root-motion animation to not move the root.
This is actually a blender Issue. The second i reverted to Blender 2.5 all of my animations needed no extra tweaking after they were imported. I find this much less of a hassle than going through unity fixing every animation you import. I know you can do it through unity, but it's about working smart not hard.
Answer by ToddToddTodd · Sep 04, 2014 at 07:53 AM
I had trouble with using animated objects made with Blender. Not rigged character animations, but objects with location and rotation animated. The object was misplaced during play no matter where I positioned it with play off. I know the Mecanim can animate it as meat5000 talks about(I've used that before but would need a refresher). I want to have a thorough understanding of how things work in Unity. Eventually you want to know it well or else you a lot more mysterious problems like this one.
However for a short term solution I have found that parenting the object ( as zanearn says above) or animating it in Blender with a rig can fix the problem.
I had trouble when I tried to make a prefab from an empty and instantiate it. When I did, there was something wrong. A script node didn’t remember what was assigned to it or something.(can't remember for sure). However, I got it to work by making a sort of false empty.
Here's what I did.
Create a primitive object such as a cube in the hierarchy.
Then turn off or remove the collider and mesh renderer for the primitive. Now you have an object that can work as an empty but is not really an empty.
Parent your imported object to the primitive.
Then you can bring the primitive back to the project window to make it a prefab.
I don't know if I needed to do this, but I was having trouble otherwise.
Second Method .Another solution is to rig and animate the object in Blender rather than using simple location and rotation animations. (This won’t work for simulations of course. )
Steps: 1. Create one armature bone in Blender and parent the object to it. All vertices will attach to the single bone, so you won’t get any deformations. 2. The location and rotation of the object can then be changed by animating the location and rotation of the bone in “pose mode” just as you would with a character rig.
Your answer
Follow this Question
Related Questions
Blender Animation Looping Delay Problem 2 Answers
How to make natural character animations? 1 Answer
Exporting a Bezier cirlce from blender to unity 1 Answer
Blender Animation Problems 3 Answers
split animations problems 2 Answers