ALS V4 Hand-Weapon alignment

Hi,

I was wondering if someone could explain, or just point out in the project, how the objects like the rifle or the bow are aligned with the main hand they’re equiped to.

I’ve been looking all through the project and can’t seem to find where this happens. At first I thought the offset was hardcoded in the UpdateHeldObject - AttachToHand call, but all the offset inputs were 0,0,0. The virtual bones themselves are at the hand bones, which are more around the wrist. But when equiping these objects, they somehow appear in the correct position in the palms of the hands.

I just want to understand how this is done (besides manually rotating and moving a socket with a preview mesh to get the correct placement), so if anyone can explain it, or just point me to the place in the project where it happens, I would really appreciate it.

Thanks, in advance!

Hang on a minute there.

Why would grabbing a single handed weapon not have to be adjusted based on a socket manually for each character mesh when you first create that socket?

I’m not versed in ALS, but the way I do this is I have a dedicated socket on a weapon bone. And most of the animations move/throw/swap hands etc by animating the weapon bone.

Doing it any other way is just insane. You’d only really realize the first time you tried to make a complex animation from mocap work I suppose.

Now that said.
Each weapon has its own offset settings for when you attach to socket.

You can do that many ways. I just have exposed variables you tweak at runtime to adjust things.

1 Like

Yeah, I’m only starting out with unreal, I’ve been trying to wrap my head around the different ways of doing things. The weapon bone is an awesome idea, I’ll definitely keep it in mind for when I get to that point (complex animations).

And you’re probably right about the tweaking the offset, but I cant for the life of me find where in the project he does it. The sockets (or virtual bones in this case) are located on the hand bone, like at the wrist, but at runtime the hands are nicely aligned with the weapons.
I’ve broken a few things in the Anim_BP, and the I can see the weapons being added at the wrist then, with a 90 degree inside rotation. I’ve also seen that the offset in the AttachToHand function can move the weapons around. But I’ve yet to find the place where the offset is being corrected in the first place.
I’m sure I’m missing something. And I know there are probably different ways of doing things, but the fact that I don’t understand how this is being done means I’m missing some sort of information or knowledge.

But thanks for the reply!

Check to see the animation blueprint has some sort of node to move the virtual bone around.
It could be hidden in a post process BP or something.

I’m an idiot, I think I found it.
I was so fixated on finding numbers, I didn’t check the poses used in the animations. The ik_hand_gun bone is animated into the proper place in each pose in the, for example, Bow_Poses animation.

I think this is what you meant by using a weapon bone maybe? Sounds like you were right on the money the first time around haha.

Thank you for the help!

1 Like