Hello everyone,
As title describing what I am trying to do here. How to achieve this?
Thanks
Edit
More details:
It’s an orthographic camera with ortho size 60.
Hello everyone,
As title describing what I am trying to do here. How to achieve this?
Thanks
Edit
More details:
It’s an orthographic camera with ortho size 60.
Seems pretty simple. Just find the distance between Camera.ViewportToWorldPoint(Vector3.zero) and Camera.ViewportToWorldPoint(Vector3.one / 2) and add that to your object’s position to get your camera position. Offset depending on the size of your object.
Thank you. Pretty simple for you but not for a newbie like me
. If you can please share the script.
It’s an orthographic camera with ortho size 60.
I don’t really know how to get more simple than that, I already gave you all the code and math you need, you just need to put it together.
Thank you. I think I got it now. Here is the script:
Camera cam = Camera.main;
Vector3 dist = cam.ViewportToWorldPoint(Vector3.one / 2) - cam.ViewportToWorldPoint(Vector3.zero);
cam.transform.position = portal.transform.position + new Vector3(dist.x - 45, dist.y - 45, cam.transform.position.z);
Not sure what your game is but there’s another potentially-interesting approach: an oblique camera frustum.
In this case you would set the obliquity to make the camera axis be down at or near the lower left corner.
Pretty cool camera trick!