public static void TransformWithParent(out Quaternion childRotation, out Vector3 childPosition, Quaternion parentRotation, Vector3 parentPosition, Quaternion startParentRotation, Vector3 startParentPosition, Quaternion startChildRotation, Vector3 startChildPosition)
{
childRotation = Quaternion.identity;
childPosition = Vector3.zero;
//set the parent start transform
tempParent.rotation = startParentRotation;
tempParent.position = startParentPosition;
tempParent.localScale = Vector3.one; //to prevent scale wandering
//set the child start transform
tempChild.rotation = startChildRotation;
tempChild.position = startChildPosition;
tempChild.localScale = Vector3.one; //to prevent scale wandering
//translate and rotate the child by moving the parent
tempParent.rotation = parentRotation;
tempParent.position = parentPosition;
//get the child transform
childRotation = tempChild.rotation;
childPosition = tempChild.position;
}