I am trying to fine tune my scene. But my camera gets a LookAt
from an attached script. Therefor when pressing play the camera frustum shifts slightly to the LookAt
position I gave it in the script. Is there a way to have it do this from within the editor so I know the exact starting point of my camera so I can set things to line up properly within the editor from the starting view of the player?
I am assuming that when you say camera.lookat you are referring to the LookAt() function, and to my knowledge you should be able to just set the target using a Transform or GameObject variable type.
There is a class that deals with this called ExecuteAlways
. I’m using the code below on my camera. You can find the docs here.
[ExecuteAlways]
public class Cam_Target : MonoBehaviour
{
public GameObject target;
void Update()
{
transform.LookAt(target.transform);
}
}