Announcement

Collapse
No announcement yet.

Take a weapon and then attach to socket

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    Attach a weapon to a socket in skeletal mesh:

    Click image for larger version

Name:	attachweapon.png
Views:	3
Size:	104.4 KB
ID:	1468996

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

    Click image for larger version

Name:	drop.png
Views:	3
Size:	112.5 KB
ID:	1468997
    "I have harnessed the shadows that stride from world to world to sow death and madness."

    Comment


      #3
      Thank you very much, that helps a lot!

      Comment


        #4
        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 https://www.youtube.com/watch?v=YVC-DL9Ibf0 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.

        Comment

        Working...
        X