- Home /
Best way to attach two handed objects on character?
Hi everyone,
I've successfully created a new character with Fuse rigged it with Mixamo and imported it to Unity. Now I try to attach a rifle to this character, which uses some of the amazing Mixamo SWAT animations.
I know I've to add this object to the skeleton hips of the model. I successfully add a pistol to the right hand index 1 and archived that it is translated correctly in the pistol idle animations:

I attach the object using this simple scripled:
using UnityEngine;
public class AttachObject : MonoBehaviour {
public Transform attachPoint;
public Transform obj;
void Start () {
obj.parent = attachPoint;
obj.localPosition = Vector3.zero;
}
}
The weapon object itself is a child of an generic GameObject, which is centered at the origin of the coordinate system. The weapon child object has the required translations and rotations to align the weapon at the right hand.
But how I handle two handed objects like a rifle? I have added the rifle to the same right hand index hip and could move and rotate it successfully that it looks somewhat ok with one of the rifle idle animations. But when I switch to an other animation I have the problem, that the angle of the rifle changes and the result looks weird at the second hand (fingers are overlapped by object mesh or vice versa).
I also tried to use a hip of the second hand als ancor-point and perform a LookAt rotation, but I failed also.
Any help is appreciated. Best regards, Hellhound
BTW: I'm a programmer and by this reason I've less or zero experience with 3d modelling tools. By this reason I prefere solutions without using any pre modelling tasks.
$$anonymous$$y frist guess would be to use inverse kinematics on the hand which is not on the trigger. https://www.youtube.com/watch?v=EggUxC5_lGE
you can try use 2 FixedJoint conecting each hand to the gun.
Your answer