I have made a character using MakeHuman, imported to blender and created a view animations. Then I imported the character as .fbx file into Unity. I set up an FPS scene with a player holding a gun in front of him. The camera is inside the character's head and the character is inside a capsule which is the actual movement controller. I basically just set the parent as needed. So if the gun should follow the hand I make the hand to be parent of the gun in the hierarchy.

I want the gun following the camera, so it is pointing exactly at the center of the players view where a crosshair is positioned.

But when I let the gun follow the camera, I can't let the hands follow the gun. And if I let the hands follow the gun, I can't let the gun follow the camera.

Is there some logical error in my mind or is this a common situation to find some individual method?

  • \$\begingroup\$ Usually hands are snapped to the gun with inverse kinematics, or "IK" — try searching that term and you should find lots of leads. \$\endgroup\$
    – DMGregory
    Apr 6 '19 at 23:55
  • \$\begingroup\$ I know about them, i rigged my character using them too for elbows and knees (in blender). But how can i bind the bone to the gun inside unity? Or should i include the gun in the fbx? Until now i load it from a plain obj file not related to the fbx. But then i have the same problem with the camera. Should i include everything (including weapon and cam) into blender and export them (and theyr relations) to the fbx too? \$\endgroup\$
    – MBrain
    Apr 7 '19 at 0:29
  • \$\begingroup\$ Maybe you could try this: Make the character control the gun as your idea was. Then, camera would follow the gun by a script which would add a bit of artificial lag (use a LERP to rotate the camera). For hands... I would just connect them to the gun. It seems more natural if hands are a parent of the gun, but you can do it the opposite way too I guess \$\endgroup\$
    – lilKriT
    Apr 7 '19 at 1:03

You must log in to answer this question.

Browse other questions tagged .