Hi,
I am fairly new to Unity so please forgive me if this question has been answered before. I am still a noob! ![]()
What I want to to is build an interactive world where the player can pick up objects.
I have a pair of hands visible and attached to a FPS controller and I need any interactive object that the player clicks on to become attached to the hand bone.
I have looked around the forums and have seen recommendations of parenting the mesh to the player hand so I thought it would be fairly straight forward.
My code inside the interactive object is:
// H2 is the actual bone that I want to attach
// the object to...
leftHand = GameObject.Find("hand_left/H2");
gameObject.transform.parent = leftHand.transform;
However when I do this the object seems to parent itself to the hand in the hierachy window but disappears from view.
I have tried to look at the scene in wireframe just in case the mesh was being attached in the wrong position…It seems to attach itself initially (not in the intended position) and then just disappears even though it is visible in the hierachy inspector.
Am I doing something wrong? Any help would be appreciated.