Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Grab weapons with character hands automatically and correctly

Discussion in 'Scripting' started by DaniilGalahow, May 24, 2018.

  1. DaniilGalahow

    DaniilGalahow

    Joined:
    Dec 2, 2013
    Posts:
    12
    Hello!

    I have a question, but it's difficult even to formulate it.
    Is there a way to link a bone with an object?

    Why I need this? For example, I have a bunch of weapon models, and a model of character. So, I want? that, when I add a weapon to a character, he grabs it automatically with his hands.

    I thought about realisation, maybe it can be like this:
    1. After importing to Unity a model of a weapon, I add to it a pivot points (empty game objects, placed where wrists of character must be, and oriented as wrists must be oriented)
    2. After adding a weapon to a character, I copy a transform from pivot points to wrist bones of the character...

    But - how to make that elbows of character positioned correctly in that case? How to deal with weapons with non-standart grip (for example, rocket launcher)? Maybe this can be realized via ragdoll?

    Any suggestions acceptable.
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. DaniilGalahow

    DaniilGalahow

    Joined:
    Dec 2, 2013
    Posts:
    12
    :D "When all else fails, read the instructions." (c)
    Thank you!
     
    LeftyRighty likes this.