3rd person weapon equiping
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.
Answer by Spectra_7 · Oct 06, 2018 at 12:59 PM
Late answer.
You can create an empty game object and add that gun model as child of the empty game object. Next edit the pivot of the empty game object by changing the pivot mode to "Pivot" instead of center, which you can find next to move,rotate,scale button on the top.
Change the pivot of the empty game object so that it is at the grip of the gun.