Download

Take a weapon and then attach to socket

Hello so high level design is that on button press weapon grabbing
animation plays, attaches a weapon from level to socket.
How can this be implemented?
I have an animation for that.
My way to implement this is bad. I have weapon already attached to the character, it is invisible by default. I just make the weapon visible on button press to “grab it” when overlapping a weapon blueprint collision box in the level (and I make the weapon mesh in its blueprint invisible and set no collision). I have not implemented any animations for grabbing yet, and I need the weapon to get attached to the hand socked when the character’s animation is grabbing the weapon. Is that done through delays, collision overlaps(can I specify collision for only 1 bone?) or there is a more efficient way?
Another point is that I need to be able to drop the weapon. It just needs to physically drop down from hands, right to the ground.
Is there ik involved? Line traces?
How to do it please halp

Attach a weapon to a socket in skeletal mesh:

Drop weapon: for example, detach -> activate physics -> set collisions to ignore pawn (this means it falls right through his hands):

Thank you very much, that helps a lot!

To handle attaching during animations, look at using the anim montage with montage notifies. During the animation, say right before the character starts to rise back up add a montage notify. In you Character, Play the montage on button press and on Notify execute the function for attaching the weapon. Check out the UE live training here Character Animation in UE4 | Live Training | Unreal Engine Livestream - YouTube about using montages if you are unfamiliar. The don’t cover the notifies and the advanced node that uses them very much but they make mention and your imagination can fill in the rest.