I’m trying to move the editor scene camera. I’m able to get the position of the camera easily enough (using a script that extends EditorWindow):
//getting camera position works:
if(Camera.current) {
var sceneCameraPosition = Camera.current.transform.position;
Debug.Log(sceneCameraPosition.ToString());
}
But I don’t seem to be able to set the camera position:
//setting camera position FAILS silently:
if(Camera.current) {
var newCameraPos = Vector3(2000,2000,2000);
Camera.current.transform.position = newCameraPos;
}
The script reference docs say that Camera.current is read only, so am I trying to do the impossible here?