2
\$\begingroup\$

I'm making a 2D game and i need to get the corners of the camera in world cordinates. Is this possible in unity?

\$\endgroup\$
5
\$\begingroup\$

Yes, Unity allows you to get the corners of the camera in world coordinates.

Camera camera;
// gets top-right coord
camera.ViewportToWorldPoint(new Vector3(1,1,camera.nearClipPlane);

Please see the Documentation.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.