I’m trying to figure out how I could make the character hold the weapon by the grip. Right now I set the gun position and parent it to the hand bone, but this will place the weapon in a wrong place.
this.transform.position = Holder.transform.position;
this.transform.rotation = Holder.transform.rotation;
this.transform.SetParent (Holder.transform);
This is the current code ^
My only idea was to set a gameobject to the exact grip position (for every weapon), and when setting the weapon position I would calculate the proper setting position (by getting the distance between the grip and gun centre pivot and adding it to the original position setting vector). This way it is dynamic and would work for every weapon (which has the grip empty gameobject). I’m not sure if it’s a good way to do it though.
This is how it holds the weapon right now.