How place object in forward direction of the camera, even if camera is pointing to the ground or the sky?

I want to place one object in front of the camera, always at the same distance…

So if I am looking the ground, the object will be also at the same distance that if I am looking forward.

At this moment I am able to place the object at 2 meters when I am looking straight but If i am pointing to the ground with the camera , the object is placed closer than 2 meters.

Thank you

EDIT: Okey , I already did it.

object.transfrom.position = camera.transform.position;
object.transform.rotation = Quaternion.Euler(0,camera.transform.eulerAngles.y,0);
object.transform.Translate(Vector3.forward * 2 , Space.Self);

and thats it :smiley:

add projector component to some gameobject and make child of camera make it orthographic and u can also mange it with 2 cameras by handling layers.
assign layer to object and 2nd camera assign only that layer you achieve what you want. ask anything you need further.
thanks

Drag and drop the object under the camera, and when your player with the camera moves, so should the object. If you haven’t attached it already, drag the camera under the player.