Thursday, July 16, 2015

Unity 3D: "Screen position out of view frustum" error

"Screen position out of view frustum" is an error almost everyone will see at some point. This can be caused by a few different things, and fortunately is pretty easily fixed.

First off, there is a bug (at least as of Unity 4.5) that can cause this to happen randomly. The quickest way to find out if that's your issue is to close the "Scene" tab and reopen it from the "Window" menu. If there's nothing in your scene causing this issue, it should now go away.

If you're using an orthographic camera, don't set the orthographicSize to 0 or this will happen. Don't forget to check not only the editor, but any scripts attached to the camera -- any zooming scripts you have may be setting it 0 as well.

The last issue I've seen that causes this error is having a camera with a near clip plane set to 0. Again, don't just check the editor; make sure you look at any scripts manipulating the camera.

If anyone finds any other issues that can cause this error, let me know and I'll add it!


4 comments:

  1. I was having this issue when rendering with multiple cameras at once.
    The solution was to set all the other cameras except the main one to Camera.tag="Untagged"

    ReplyDelete
  2. I recently got this issue when using water reflection effect (got from unity wiki) together with partical system. A temporary solution is don't reflect particals.

    ReplyDelete
  3. It's still present in 2020.1.11f!

    ReplyDelete
    Replies
    1. Wow, I haven't seen it in a long time. Does reloading the Scene tab still fix it?

      Delete