Search Unity

How to attach gun to my model

Discussion in 'Animation' started by Eiseno, Nov 29, 2015.

  1. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    83
    Hi, I am making co-op FPS game for HTC Vive. As u know vive has 2 controller and can track their position.I think i need full body model for co-op game.For gun i must attach gun model to models hand but i dont know how to attach gun to model hand. When gun position changed i need gun position change too.

    How can i do this ?
     
  2. Ysgramor

    Ysgramor

    Joined:
    Jan 23, 2014
    Posts:
    69
    u can use IK hand system, then u can play with target hand gameobject (u can make new empty object and rotate, move in play mode until get best result)
    if the hand position good enough, attach gun to hand bone (finger parent bone).
    u can get Ik sample scripts here http://docs.unity3d.com/Manual/InverseKinematics.html

    EDIT:
    dont forget to make hand target object child of gun object