Help about understanding ceratin command problem

Im trying to use Camera.main.ScreenToViewportPoint(player.position)
well since MainCamera is attached to player in hierarchy shouldnt this always give same position i mean player and camera move together and their relative position is the same but somehow when i use this on every frame its changing as player changes and it changes a lot ?

// Vector3 playerpos = Camera.main.ScreenToViewportPoint(rb.transform.position);

am i missing the definition of command or do i have a bug ?

ScreenToViewportPoint takes a position in screen space and transforms it into a position in viewport space. You are feeding it with world position (that’s my guess, I can’t tell) which just does not make any sense. Actually I can’t really tell what you are trying to do? Maybe try to describe what’s your intended result