Play animation montage with attached weapon floating around

Dear experts,

I’m a beginner and I hope you can give me a hint what could be the problem:

I have created a socket for ik_hand_gun that I have animated in the anim sequence. It’s an equip animation where the ik_hand_gun is rotating and pass the weapon from one hand to the other.

When I attach a weapon to the socket and replay it in the anim seq as in the created anim montage, everything works fine.

But when I play the anim montage with the blueprint, the weapon is floating around. Originally the weapon is attached to a socket at the back, I play the anim montage and when it gets a notify I attach the weapon to the ik_bone_gun socket.

Any idea what could be the reason or where I have to dig deeper?

Thanks in advance!

Hey @c0ldsun! Welcome back to the Forums!

It is a bit hard to tell what exactly is going wrong with the info so far. Do you mind sharing your blueprints so we can get a better look at what may be going wrong?

In the meantime, check out this non-Epic affiliated tutorial on spawning actors at socket locations to see if this contains the solution you need!

Any additional information you can provide will be a big help in solving your problem.

Hi,

Thanks for the tutorial. I have problems with the ik_hand_gun. Left the animation montage problem aside, even when I spawn the weapon, it is not snapping to the ik_hand_gun.

This is how it looks like in the anim seq. Everything is fine.

This is the spawn/attach BP

This is how it looks like in game


The weapon is hovering around.

As mentioned, I had chosen the ik_hand_gun, because it is animated for an equip montage where the weapon is rotated and moved around, adjusted through keyframes of the ik_hand_gun.

I’m looking into this since weeks and had no luck to fix this, do I miss something that I need to adjust IK bones in Anim BP? But why is then anim seq playing fine? Any hint in which direction I can search is welcomed.

Thanks!

Hey @c0ldsun!

IK bones are attached to the root and generally you do not attach sockets to them, you would attach the socket to your hand. Because of that, your gun will not follow your hands at all, but will follow the root of the model (why it looks good in the non montaged skeleton/animation). Here is more information on IK from a great non-Epic affiliated video:

Unreal Engine 4 Tutorial - IK Part 1 - Understanding IK

TL;DR; IK bones aren’t meant to have anything weighted to them and are used for different purposes, so move your socket to your hand to get proper results.

1 Like