is it possible to to change the camera’s origin point(the cameras 0,0 position)
to the top left corner of the camera itself?
right now it look like the camera’s origin(0,0) is the center
is it possible to to change the camera’s origin point(the cameras 0,0 position)
to the top left corner of the camera itself?
right now it look like the camera’s origin(0,0) is the center
Yes and no. I’m having a hard time answering since the approach here seems a bit off.
The short answer is: move your camera down in the negative y-direction and to the right along the z-axis. If the camera is orthographic, the amount to move should be
var aspectRatio = (float)Screen.width / Screen.height
new Vector3(camera.orthographicSize * aspectRatio, -camera.orthographicSize)
The longer answer is:
In Unity you never position objects in “a camera view’s coordinate system”, so a camera doesn’t really have an origin point.
All you have is the object’s world position and the camera’s view frustum. Those are the only factors determining where on the screen an object is drawn.
Yes you can move your camera transform in such a way that the world (0,0,0) is in the top left corner. If you use an orthographic camera, it’s easier, with perspective camera it’s trickier and the distance from camera becomes a factor too.
Actually since it’s 3D there’s always a whole line segment in world coordinates on which objects appear in the top left corner. What that line segment is depends on the camera’s settings, orientation and position.
I tried you code an it has a ton of syntax errors.
please post valid code as an example as it won’t help new users otherwise.