I have two characters. Im trying to make it so one can pick up the other. Id like to get the transform of the IKRightHand from the rig and use that to position the character which has been picked up (or ideally get left and right hand and find the middle point etc).
private Transform righthand;
protected override void CustomAwake()
{
righthand = controller.otherPlayer.transform.FindChild("IKRightHand");
Debug.Log("Righthand: " + righthand);
Debug.Log("RH Position: " + righthand.rotation);
}
other player is a GameObject which I add to either character within the editor. My issue is that the first debug line shows that the righthand has been set to a UnityEngine.Transform (if it were null, the child didnt exist). However, the second debug line returns a NullReferenceException (this happens with rotation, name, anything). Why would this happen if the prior log shows that I have a valid transform component? Any ideas?