moving avatar with camera

Hi
I have set up a player object and within it placed a first person avatar and my camera. I set the camera at the eye level of my avatar but when i run the game the camera moves to the feet of the avatar.
I am moving the player object around my game based on choices. This is the code I am using:

playerObject.transform.position = targetMainSmall.transform.position;
playerObject.transform.SetParent(targetMainSmall.transform);

How do I fix so the camera stays at eye level and doesn’t go to the feet?
thanks

seems to have fixed itself!