Imported Animations Animate Backwards or At Weird Angles

My Blender Animations are imported into UE4 and will animate, but will jump to a random position once animating (like when I assign the play animation to a button press such as R). So after R is pressed, the animation will continue until the frames have stopped and the object will still be at the weird coordinate that it jumped to after R was pressed. Any help?

For example, if I was animating the double barrel shotgun animation, the barrel jumps to a coordinate that is not at the end of the stock of the shotgun, and continues its animation of reload, but may also be rotated 180 degrees.

IMO that could be a few different things. Maybe one could be how you made the animation sequence and or how you setup the state machine and blend space. For instance when setting for a key press to fire off an animation event it needs to connect back to its original state or else it will freeze on the last frame of the animation and stay that way until another animation state is fired.
As for the animation rotation that could possibly be on how you animated in blender. For instance were all animations keyframed y forward?
Did you move any object forward or backward from center of origin?
Did you apply rotation before exporting from blender if any object was rotated in object mode? Those are a few things I can think of.

Everything seems okay in blender. I can play the animation fine there but when it is imported into UE4 I get multiple animations, all of them except one have no animation (the object just sits there) and the last one with my supposed animating object usually animates in a strange way, different to every time I edit it inside blender (with the animation playing find there) then bring it into UE4 and it animates weirdly. For example, an animation that should just have an object rotation 45 degrees over one axis has the object pushed out then over-exaggerated-ly animates the rotation over the wrong side of the axis.

Could you upload the blend file to a Google drive and either pm me the link or post here if you feel comfortable doing so? I’d be happy to look at it and help solve the issue.

Try rotating the barrel over the y-axis 45 degrees. Add that as a frame between two resting states of how it appears once you open the blend! (R + Y … 45)

Blend: pasteall.org - This website is for sale! - pasteall Resources and Information.

hey, im looking at the model now, right away i notice the model is actually not modeled on the proper axis. 3 on the number pad should display side view with the front of the model going left of the z axis. While you can model any which way you want across any axis, getting into good modeling habits like I described will prevent further problems when exporting into other programs not just unreal. all 3d applications have the potential to import a model wrong if not exported in the way they expect to read a model. for instance unity has a Y up Z forward axis. Thankfully blender and unreal are not that unalike. I am going to try to animate with the model like this and then like I do to see if that was the issue. =)

A few things here just as a modeler. Always keep your model centered on the x,y,z axis’ that way you avoid problems when applying modifiers that are axis dependent like mirror modifier or array it doesnt make more problems. Your origin is also important to know where it is and should be for what you need to do. animations are heavily dependent on origin point as the keyframes key location/rotation/scale. So to fix your current problem do this. press 3 on the number pad and rotate object on the z axis. on both gunstock and barrel in object mode hit ctrl a and select rotation and location. then aninimate as you wish. If you didnt know in the nla editor you can name your animation and press f to save it in memory, when you hit the + sign to make a new animation the current one will not be lost.
So I am now experimenting with weightpainting the object to two bones so that you can import this as one model, that will eliminate the set of animations for the gunstock. and the errors it generates. Its normal for the error to come up that there is no bind pose and will be set to 0. Ive never had a problem with this error so i have not attempted to figure out how to fix it. I will send you the finished blend file when I am done

Where in the NLA editor can I save my keyframes to a named animation?

I notice the Origin moves along with my animating barrel. This must be the cause for the UE4 picking up its transform and not just rotation. Is it possible that it could be kept stationary?

There are a few different ways to animate an object like this and honestly I can’t tell you for certain the absolute best way. But I can lay out some options for you and I’ll post a few pictures on how to get to the NonLinearAction editor screen in blender. When you export an fbx with animations unreal picks up on that and expects to see bones for animation. Bones are not always needed but since you have a two part mesh, gunstock and barrel, bones would be good with proper weight painting that way you can import the gun in as one mesh. Though the gunstock doesn’t move having a bone there stationary is a good way to ensure it stays that way and isn’t influenced by the animation of the barrel. And the other way to look at it is to make sure the barrel will always rotate properly in relation to the gunstock. Origins can be used to act as pivot point like if the origin of the barrel was at the receiver end of the gunstock and dead center of the barrel then translations or rotations will always be in relation to that point in blender. Unreal doesn’t really pickup on the origin point. With bones in your mesh you don’t have to animate this object in blender, you could make this unreal because its simple enough. I usually don’t recommend any animation editing in unreal but it is possible. Stand by for the pictures.

Thanks, I wasn’t sure if UE4 had the ability to apply rotation to a part of a skeletal mesh, even if there were bones involved. I’d appreciate the photos or a guide on how to save an animation w/ a name, as + for me only changed the zoom for the timeline.

Here you go. steps for nla. Good luck. Send me a message anytime for blender problems. Happy to help.

ignore the handle pic I realize that if you just change the editor layout from default to animation, it splits views for you =) So look at animation pic first, then action editor. The axis pic is just a reference for good modeling techniques. I recommend looking at blenderguru. its free and andrew price makes some fun tutorials. But I learned the most from cgcookie… some of their stuff is free but for $20 a month you get access to training programs with a workflow to teach you things like animation techniques, how to rig and skin a model, hard surface modeling, some game design things too. They dont have an unreal side yet but im sure its in the works. Cheers!

Thank you so much for the thorough walkthrough of how this stuff works… I’ve been struggling with this all day.