Hi,
I would like to put the white rectangle in front of the camera at a certain distance.
It works when the object is at the same location as the camera, just in front of the camera, it copies the right rotation and position. But with a distance between them, such as *10, it does not follow the path of the camera’s forward, and it is located a bit up. Does anyone know why?
Here is an image :

And the code :
//cam position
cam = Camera.main.transform;
vecCam = cam.position;
//in front of cam
white_Vec = vecCam;
white_Vec -= (cam.position.forward * 10);
rect = Instantiate(Resources.Load("rect1"), white_Vec, Quaternion.identity);
var angles = cam.localEulerAngles;
rect.transform.localEulerAngles = angles;
Thanks a lot