Weapons, and Hand Placement

goal: Have player be able to place hands on different weapons, with different hand locations.

How i think it would do this:
Now when writing this i’m really not sure how i am supposed to set up my animated weapon in my program.Heres a picture of what i have now:

9ac04cb3cd01a720a7a7f88b60ceede51edd922a.jpeg

As you can see, if i was to have it exported the hands or bones are in different positions>>>>>>> when holding different weapons.

Right now i have the weapon, as an object that has no bones, and has just been parented to the hands,

How I am supposed to bring in object the player is supposed to hold with 2 hands? That have there own seperate animations?
Such as a shotgun firing, and reloading, and pistol firing and reloading…The both have indivual animations where the hand in different positions? Should i just animate this? Like honestly i’m so confuzed i don’t exactly know how to explain the dillema, i just know what i want to achieve. How would you go about doing it? I’m open to any suggestions, Because i haven’t really seen people tackle how to handle multiple weapons, and switching in and out of the weapons and there individual animations.

All i feel like i need is a point in the right direction on how to handle this.

Please and thank you :slight_smile:

Ya dude, make different sets of animations for each gun then use the right set when the gun is equipped. Typically you’ll attach the gun to one hand in past projects I’ve used the trigger hand as the attachment hand. Then the forward hand just works out. There’s fancier **** you can get into with runtime ik for aiming and fixing up anim compression but don’t worry about that at this point. Just make all the anims for each gun.

/ Kyle

if i make the anims, for the different guns, and attach 1 hand , while the other plays off of animation…Won’t it be floating around? Because its not hard attached? I am planning on having aim offsets, and they can often times mess the placement of stuff up, oh and almost forgot, thanks for the reply

Have the gun parented to the right hand and then put an IK target in the gun for where the left hand is supposed to go, use IK to ‘snap’ the left hand in place.

Thank you, this is the answer i was looking for. but how exactly would i create an ik target For the gun? I’ve seen in unreal engine the animgraphs 2 bone ik …Or would i use something else? Plz help

It depends on how your weapons system is setup, In mine the weapon is a separate actor with it’s own skeletal mesh. I would add a bone to the weapons skeleton that is parented to the root and is moved to where the left hand is supposed to be. Then in the engine I would add a socket to that bone on all the different weapons and use the same name for all sockets. Then it’s just a matter of getting the socket’s location and putting that value in the two bone IK node.

Thank you sir, I I will definetely give it a shot, and can’t wait to implement it :smiley: :smiley:

Hi Nabiul-
Have you had success with this technique? If I use the Two-Bone IK node to IK the left hand to a socket on the weapon, I find that the IK location is always 1 frame behind. To elaborate, we get the EffectorLocation in the event graph, by getting the socket location on the weapon. When the next frame of animation is evaluated, however, the right hand is likely to move, causing the EffectorLocation to no longer be valid. The IK is performed using this stale EffectorLocation. The end result is that as soon as the right hand starts moving, the left hand always lags behind. Any ideas?

I managed to get this working as follows. Instead of getting the weapon socket location each frame (in world space), I just get it once from the CDO (in weapon space). Since the socket location relative to the root never changes, this is exactly the offset that’s needed. In the Two-Bone IK node, I set it to use BCS_BoneSpace, set the effector bone to the right-hand weapon bone, and set the effector location (offset) to the variable holding the weapon-space offset. That offset is then applied in bone space to IK the left hand exactly where I want. Hopefully it will be useful for someone else.

can you post a screenshot showing how you did this? I’m not sure of some of these acronyms…

This should help you gain a bit more understanding of some of the terms @Xanen was talking about.