So I have a feeling this is very simple, but can’t get it right.
I want a horizon plane to follow the FPS style camera so the plane is always visible on the horizon. I came up with the following script. Problem is Vector forward also calculates directions. So when I look straight ahead, the horizon is at the desired distance. But, when I look up of down with the camera, the horizon comes towards the camera…
horizonObject.transform.position = Camera.main.transform.TransformPoint(Vector3(0, 0, 70));
horizonObject.transform.rotation = Quaternion.LookRotation(horizonObject.transform.position - Camera.main.transform.position);
horizonObject.transform.position.y = 0;
horizonObject.transform.rotation.x = 0;
horizonObject.transform.rotation.z = 0;
Hope someone can help me…