- Home /
Restrict 2D camera with a Quad?
Hi, I want to restrict my orthographic camera movement. Now I know this is doable with Mathf.Clamp, however I'd like to know if there is some way to use a Quad for the task. The obvious benefit would be the ability to resize the camera boundaries simply by scale-ing the quad in x/y.
So should I clamp screen coordinates with Mathf.Clamp, or is it better to draw a quad, then store it into a Rect and then what should I use? Mathf again or use if statements for rect height and width? I'd just like to make it as cheap as possible, seeing how Mathf.Clamp route is gulping transform calls every frame.
Comment