Weapon's rotation issue while playing planted in the ground animation

Hi there,
I’m fairly new to UE5 and I’m so far loving it !

I’m currently struggling with something I thought I would implement quickly but with no success so far !

My current character animations are all based on Manny skeletal mesh and I’m using the Third person character BP

GOAL
What I’m trying to achieve is an attack where the character plants his weapon on the ground, smahes it so it goes down further down in the ground (creating a magic wave around the impact), and he grabs it back to get back in idle.

This weapon is fairly simple in terms of rigging, but I have other ones that will require more complex rigging and still behave the same way.

TRIALS
What I tryied so far with the better result :
In the Third person character BP I created a skeletal asset for the weapon, parented to the charcter mesh, and using the ik_hand_gun joint as my parent socket.
In Maya, I constrained the ik_hand_gun joint to the weapon so it follows it.

When navigating around, my weapon is placed the way I want. But once I trigger the animation montage from the binded keyboard key, the animation plays fine, translations are OK but the rotation is wrong !
If I want to have the weapon properly rotated during my animation, I have to apply odd rotations to the skeletal mesh transforms (-90, 2.11, 13.3). But it’s not properly aligned anymore with the hand when walking around…

QUESTIONS
Do you guys have an idea of what I’m doing wrong ?
I also tried dealing with sockets, but same thing so I’m a bit confused.

Thanks a lot !

Sébsatien

Hey @SebastienMULLER! Welcome to the forums!

I think I understand what is happening. The rotation of the weapon is still getting rotation from the constraint. Personally I’ve never done it this way, typically I’d have the weapon be a separate actor. Then to attach it, you spawn the actor and attach it to the socket on the skeletal mesh- that being said, with this animation, that would come with its own problems.

What I’m thinking is- have a second mesh of the weapon. Then, as part of the animation, make the weapon in your hand invisible, but have the backup teleport to the spot where it would be lodged in the ground.

It’s actually a very similar idea to how sheathed weapons work in many games. The sheathed weapon on the back or hip and the weapon in the hand switch visibility as part of a sheath/unsheathe animation.

Hope that helps!

Hey @Mind-Brain ,
Thanks a lot for your reply !

The thing is that all the animation is baked character’s joints from Maya, so no constraint is exported to UE5, only the skeleton of the character.
The weapon is not even animated, it’s attached to the ik_hand_gun joint and getting the animation from it.

I was probably not clear enough when explaining what I did.
I actually already have the weapon as a separate actor added as a skeletal mesh in the Third person character BP

I also did it the way you mentionned, spawning the weapon and attaching it to the bone I want with same result

It sounds a bit complex for what I’m trying to achieve but I’ll give it a try.
I indeed saw a lot of videos about drawing and sheathing a sword and get notifs from the animation montage to know when to play with visibility, it would be worth going this way.

On the side, I’ll double check the Maya rig and see if the ik_hand_gun joint is not receiving any rotation during the rigging process, preventing me to have the exact same values as the original Manny skeleton and giving me this offset.

Thanks a lot and I’ll post my tests as soon as i can !

1 Like

Hi there,
I finally found something working by swaping the parent socket when playing my animation.

The weapon skeleton mesh is attached to the ik_hand_gun joint of the character

When I play the attack animation montage, it triggers an anim Notify at the very begining of the animation. In the event graph of the Manny ABP I’m then attaching the weapon to another socket llike so:

Then, once the animation is done, I have another anim Notify at the very end of it to attach the weapon back to the ik_hand_gun with the right offset

For the sake of the tests we’re currently doing, we still use the default Manny animations.
Once we’ll have our own animations for everything related to the locomotion, we’ll make sure the ik_hand_gun joint is animated properly to avoid having to deal with the socket swaping process

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.