How to rotate object with camera around y axis only of player?

Ok so I have a player, a ball that rolls around, and I want this object call it x to rotate around this object with the camera. So x rotate around the Y axis ONLY of the player. I want x’s position to always be “some distance” units to the right of the player from the camera’s perspective. NEVER above, below, or to the left of the player at least when looking through the camera. Also x should not rotate itself just float next to the ball-like player.

Things I have tried and why they don’t work:

Parent to object:

The x rolls with the object. Meaning that when the player rolls left or right x rolls over top of the player or underneath. When the player rolls forward x rolls end over end.

Parent to camera:

When the camera looks up and down x moves and in this case it should not move only when the camera moves left and right.

Create Empty and set it to the center of the player and parent x to it a set distance away:

This almost works but I still can’t get x to rotate around the empty properly.


The following picture is to help you understand what I mean. The view is from above the objects looking down.

NOTE:
The 3rd camera is missing from the picture but just imagine there is an up arrow where the 3 is in the bottom diagram.

I have tried to make this a short and clear explanation. It really should not be that hard but I m currently at a mental block and looking for suggestions. Thanks in advance.

Here is some code that will position ‘X’ correctly:

var trPlayer : Transform;  // Transform of the player
var trCamera : Transform;  // Transform of the camera
var dist  = 2.0;           // Distance from the player

function Update () {
  var v3 = trCamera.position;   // Construct a vector from the
  v3.y = trPlayer.position.y;   //   player to the camera, but
  v3 = v3 - trPlayer.position;  //   keeping 'y' the same
  
  v3 = Vector3.Cross(v3,Vector3.up);
  transform.position = trPlayer.position + v3.normalized * dist; 
}

Note this does not rotate ‘X’ since I did not understand from your
description how ‘X’ should rotate. Depending on the camera movement,
this code might need to be moved to LateUpdate() instead of Update().

The easiest will be to go with your 3rd solution, but add one thing. Add a script to the empty object which sets its rotation to

//Set position to player position 
transform.position = player.transform.position;
//set rotation to be the same as players Y rotation
transform.rotation = Quaternion.Euler(0, player.transform.rotation.eulerAngles.y, 0);