Copy Pose From Mesh won't work with extra bones

I’m practicing a third person demo recent days, and I really wonder how to make character mesh and weapon mesh interact together like reload or check the weapon.

So I decide to copy mannequin’s skeleton to my weapon mesh, look at the picture below:
(I attached the root bone of the pistol to the character’s bone named ‘hand_r’, so the bones in my weapon will be a set of extra bone in character’s skeleton)

By doing this, I can play the same animation on two skeletons, and they will perform together well.
(2 Skeletons playing same animation)

It’s easy to remind us to use node ‘Copy Pose from Mesh’ to copy parent mesh’s animation to our weapon, but it seems doesn’t work.
(seems the weapon wasn’t animated)

the offical page says the node only copies bones in hierarchy, so from my perspective, when we play an animation with extra bones on character’s mesh, the engine won’t calculate those extra bones to improve performance, thus the weapon mesh won’t act as my think.

So how to solve this problem?

Even ‘Set Leader Pose Component’ got this issue too.

My solutation is to exchange weapon mesh and character mesh(make character mesh copy weapon mesh’s animation), so the animation will be played on a skeleton that has extra bones.

i feel bad with such a method, really R.I.P.

Hello @INTERESTING_2016, both the Copy Pose From Mesh and Set Leader Pose Component should be working properly…

How did you position the pistol in the skeleton hierarchy before exporting from Maya? Is it located in the root bone of the character like the first image? If yes, you have to move the pistol root bone to the correct position related to the hand, otherwise it will keep that offset (from the hand_r to the root) when copying the animation data (like it appears in the second image).

Regarding the extra bones, you’re correct, only the bones existing in the parent will be copied, but it should be enough for the pistol to be correctly attached to the hand.

If moving the pistol root bone to the correct position related to the hand bone doesn’t work, could you share a screenshot of your skeleton hierarchy, the position of the pistol root bone, and your current ABP and BP set up?

1 Like

Thank you @brs-ianferrari .

Yes, the position of pistol is as you said, here’s the screenshot of pistol’s skeleton hierarchy in maya.
From ‘root’ to ‘weapon_r’, it’s all original skeleton of mannequin, I just added ‘weapon_root’ and 3 bones below to make animation:

Yes, move the position of pistol to the hand can make it looks well, but my key point isn’t there: Take a look at image below, I’ve made an idle animation for the pistol and its position is well, I can even play this animation using two skeletal meshes, they worked very well, so the position isn’t the key point, but rather the node ‘Copy Pose From Mesh’ cannot copy bones which do not exist in its mesh.


And the ABP setup, I just connected it with a ‘Copy Pose From Mesh’ and checked the property ‘Use Attached Parent’, see images below:

Here’s the source file, feel free to test it using Mannequins’s skeleton: [Source Files].(Microsoft OneDrive)

Thanks for all the information @INTERESTING_2016!

I think I understand what you’re trying to achieve… Indeed, I don’t think you can sync bones that do not exist in the parent, but you can still use the Copy Pose From Mesh to make sure the weapon follows properly the hand bone. To do that, you need to position the root bone of the weapon in the proper position before exporting the skeleton.

Right now, I can see the weapon root bone is located in the 0,0,0, meaning it will always keep the offset is has from the hand_r bone. If you open the pistol skeleton, you will see the transform values in the Details panel:

You want it to look more or less like this, so it’s properly positioned when it’s attached to the parent without any extra animation:

To play the shooting animation, I’d suggest you play an Animation Montage for both the player - using the player shoot animation -, and the weapon - using the pistol shoot animation. That way you will trigger the correct animation for both skeletons at the same time.

If you do both those things, the pistol should be always properly attached to the hand, and when you need the pistol to play an animation, you can play a Montage.

Please let me know if that’s clear and if it works for you!

1 Like

You’re right, playing the same animation on two skeletons is an innovative idea.

However, my character’s ABP contains lots of blend poses such as Aim Offset or Rig Control, which will make some differences between each other.

To solve this problem, I decided to blend ‘Copy Pose’ and montage animation together, the former node offers character’s base animation, the latter offers weapon’s animation.

Thanks for your help!

The way this is normally done is that the skeleton you use has weapon bones. The weapon is attached to these bones, and you animate these bones however you see fit.

What you definitely do not do - becase performance is a thing - is add the bones of the character onto the weapon creating a ton of useless overhead.

Similarly - you do not use 2 animations. Mostly because they go offsync the moment you look at them wrong.

The character is always in charge of whatever is attached to it - weapon, hat, guitar, cellphone. Doesnt really matter what it is. You recycle the same bone(s) to handle the animations.

Chanches are, you don’t need a dedicated hat bone because you can attach to the weapon bone, then attach to the headbone.
BUT - when it is less of a hustle using dedicated bones for Hat, Glasses, cape, and weapon(s) [2 bones per weapon per hand] it is probably best to do so.

Also, again, keep in mind that performance is a thing; in any occurrence, Having 2 animations play is bad because of the load it involves - on top of the fact they easily go off-sync.

1 Like

@MostHost_LA Thank you for your reply!

I have no idea how to animate weapons and characters, especially for some complex animations like changing mag or reloading the rocket launcher.

It’s hard to adjust their offset if I just attach weapon to mesh’s right hand simply. Also, I have to prepare two animation files for each weapon.

So, although the method may get bad performance in the game… but I still like it. :smiley:

In addition, some people mentioned the ‘Copy Pose From Mesh’ has 1 frame lag, I successfully solved it by changing Tick Group in skeletal mesh component. This may be useful for others who use it like me.

@MostHost_LA I wouldn’t add all the weapon bones to the main character skeleton exactly because of performance… if you end up having 10 different weapons with 5 bones each, you’re adding 50 extra bones in the main skeleton, while you could have them as separate skeletal meshes and only load them when you switch your weapon.

Correct me if I’m wrong, but I think the ideal solution is to add a Socket to the character skeleton under the hand_r bone, then attach your weapon to that Socket.

@INTERESTING_2016 The pistol would still have its own skeleton, but you wouldn’t need all the bones that exist in the character. All you would have to do is unparent the pistol root bone from the hand_r bone and import it in Unreal as its own skeleton - starting with the weapon_root bone, so you would have 4 bones it total for that skeleton.

You would then need to attach the weapon to that socket in your BP (you can keep the set up of the child skeletal mesh, and select the correct Socket in the Details panel for attachment). You wouldn’t need the Copy Pose From Mesh anymore, as it will follow the Socket you set up in your main character.

Now, to play the pistol animations, I still believe the easiest way would be to play a Montage in both skeletal meshes, one for the character and one for the weapon. I don’t think there would be any sync issues if you’re using the Play Montage node at the same time.

1 Like

You are wrong. You socket the weapon to a weapon bone so that you can also animate the weapon. The additional weapon bone is used to grab and attach the mag, or other elements.
2 weapon bones per hand are overkill, but sometimes necessity - possibly even 3 if you have an over the shoulder rifle, a side arm, and a knife and you want them all to just always be animated.

Also, for most weapons, IF you use skeletal meshes (which you should not as they are not organic) you can probably avoid extra bones but the single required one and use Morph Targets to animate the parts, which makes it easier to apply a custom animation by setting the value of the curve within other animations (such as the main skeleton) and copying it over to the weapon.

Right, it’s good to have a weapon bone under the hand_r so you can actually animate it independently from the hand, but the point was that instead of having the whole character skeleton for the weapon and using the Copy Pose, you attach it to a socket under the hand_r so it always follows it and you need few bones.

About the morph targets, have you tested its performance compared to using bones in the weapon? If you use this set up, you would still need to use an ABP with Copy Pose and copy the curve values from the parent, correct?

It’s a good solution, as you can play a single montage in the character and, if you have the weapon morph target curves in the character, the weapon should animate the morph targets at the same time. I believe it’s a longer process for setting it all up, and depending on the weapon, you would need many morph targets to achieve what you want with bones, that’s why I’m asking about performance.

1 Like

No, the character would read the curve value and use it elsehwere. So long as your curve is coded to be one frame ahead you dont need anything special.

But the point was, you dont use animations. You just change the curve value directly by scripting the curve in a timeline.

Performance doesn’t really matter on core gameplay - which character/weapon interaction is all about.

If it did, like I said, you would regular meshes and set them up to work from variables via shader.

1 Like