Hello,
I have a character with the animation “walk” that picks objects up through trigger. I have no problem doing that - I simply make the object a child of the character.
What I would like to do is to attach the object to the character’s hand (moving with the hand as the character walks).
The model of my character has many children one of which is called “Hands”. The code attached to the object is:
if((myTrigger.gameObject.tag == "PlayerB")
{
hand=myTrigger.transform.Find("Hands");
gameObject.rigidbody.isKinematic = true;
gameObject.transform.position = hand.transform.position;
gameObject.transform.parent = hand.transform;
}
Unfortunately the object is attached to the character “in general”. It has the same position as when I replace “Hands” with “Face” which shows me it doesn’t take into consideration the part of the body to which it should be attached. Could someone give me an advice?
Thanks in advance.