Importing drawer open animation from Blender, animation works, but doesn't move skeletal mesh forward

Hi, recently I’ve been having trouble getting my drawer open animation to work properly. I have open and close animations that were made in Blender and exported into UE5 as an fbx file. I have it set up with an interact line trace BP that flip flops between open and close animations on hit. These animations work great except for the first “open” instance when testing the game. Instead of “opening” the drawer skeletal mesh, meaning moving it forward on the X axis, it pushes the skeletal mesh back the same distance and then moves the drawer back to its original location. It then is able to open and close between the backwards position and the original position. To put numbers to this explanation, let’s say that I set the open animation to move the drawer 30cm along the X axis, and I set the close animation to start at that +30cm location and go backwards 30cm back to 0. What is actually happening in the game is that once the line trace hits, the skeletal mesh jumps backwards -30cm and then “opens” +30cm, arriving at 0. Then, the close animation starts at 0 and goes -30cm. My hunch is that the bone is causing these problems, but I’m not sure if that’s correct or how to change them if that’s the problem. The bone was automatically generated upon import. Does anyone have any idea for how to troubleshoot this? Thanks!
OpenDrawerTroubleshoot - Made with Clipchamp
This is a GIF of the problem.


Here are the Bone settings for the start of the animation


Here are the Bone settings for the end of the animation

Hi @bub214, I think I can help you…

How are you controlling the skeletal mesh? Are you using an Animation Blueprint or are you only playing those animations? From the gif you posted, it seems that the mesh is simply in the wrong state when you interact the first time (it’s in the open state already).

It could be a matter of just setting the mesh to use the opening animation and disable the Playing option (if you’re using play animation instead of an ABP). You can also change the Initial Position to match what you want.

If you’re using an ABP, on the other hand, you can select the Idle state animation and just control the Start Position.

But the best solution might be to ensure that the first frame of the blender file is the drawer in the closed state so it doesn’t need any extra set up.

If none of what I mentioned solves the issue or is not the case, it could be related to the blueprint set up, where the drawer might be starting in the wrong state.

Please let me know if any of that helps and, if not, could you share more details on how you’re handling that?

Hi @brs-ianferrari, thank you so much for the reply.

So the answer to the blueprint question is neither I think. I am using an actor blueprint class and here is how I have it set up in my event graph.

This is using an interact interface that I set up within the character blueprint class as shown here.

While I have the animation blueprint selected in the skeletal mesh component, there is no animation class selected.

I went through your suggestions and here is what I did. For the Blender suggestion, I went back and made sure to export it in the closed state like this:

With these export settings:

However, that didn’t resolve the issue. I made a short GIF showing both of my animations in Blender in case I’m missing something.

BlenderAnimations

After this, I went into the drawer blueprint class and changed it to use animation asset and deselected playing, but that gave the same result. I then selected the open animation as the animation asset and it did force the drawer backwards, so I do think that you are right about it being something to do with the starting state, however changing the initial position back to where I want it didn’t fix the problem and the animation just jumped back again once I played it.

I also opened up the animation itself and tried changing the transform import translation, but that didn’t seem to fix the issue.

Are you able to see anything that I’m missing? Thanks again for the help.

Could you share a quick video with how it looks now? You said changing the initial state didn’t work, but did it look right before interacting with it?

I think you could also try reimporting the mesh with the Use T0 as Ref Pose set to True. What it does is basically it updates the skeletal mesh pose based on the first keyframe you had exported. So make sure that when exporting the mesh, you have the drawer in the closed position.

Another solution for what you want to achieve would be to use a Static Mesh for the drawer instead and use a Timeline to animate it opening and closing. You can connect the flip flop to Play/Reverse to if you interact with it quickly, it’ll just go back from the current position without jumping the animation. It limits a little bit what you can do, but if you just need a linear animation, it should work pretty well.

If you’re not familiar with Timelines, you can check some documentation here: Creating Timelines in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community

Please let me know how it goes, I hope it helps this time!

Never use animations via skeletal mesh for anything that isn’t soft body in nature.

They should like brand that with hot irons on top of the FBX import or something :stuck_out_tongue_winking_eye:

The timeline suggestion above is likely the best way to go about it things.
Also applicable to doors, windows, etc.

Now Curtains are technically soft bodies, so you would use an SKM and cloth definitions on those, then combine it with a timeline to open/close them - still wouldnt bother animating the open/close animation personally, but you can and it wouldnt be against best practice, like in the case of a drawer…

1 Like