First of all I would like to apologise if I make any English mistakes, English is not my first language…
Anyway, I am working on a game called “Garfio”, a 2d game that uses primarily mouse controlls. Yesterday I started having the “screen position out of view frustum” error when I run my scenes (Yes, I tried to create more scenes and it infected them as well). I tried any solution in the book (restarting unity, restarting my computer, creating new scenes, starting the game with my mouse off the screen, messing around with some camera settings, even building and running - where the game simply crashed) but nothing worked. I don’t know what to do, and I can’t create my game like this (oviously), and I need help. I did use the latest beta of Unity 4.6 .
Can anyone help me find a solution?
Thank you for your time.
Right click on the Scene tab and close it, then right click on any other tab and open the scene tab again.
I just did some testing, changed the camera to a different one and placed the smae scripts on it, and it works perfectly. I don’t know what the problem is, so I am leaving this question open, for anyone who knows a solution, and for anyone who has the smae problem in the future.
Thanks to everyone who helped!
This Error Occur to me because i use
OnDrawGizmos() to draw an outline in screen view that shows camera boundaries.
it works on older version of unity but I upgraded and now it gives me an error (but still works).
once the error occurs at the startup I can just can clear it out and work.
Its annoying. I just delete my code and error goes away.
May be error with your code. I just try previous answer and not works for my case.
( Don’t have time to in-depth look at the code but it also use
float verticalHeightSeen = Camera.main.orthographicSize * 2f;
Gizmos.color = Color.cyan;
new Vector3((verticalHeightSeen * Camera.main.aspect ), verticalHeightSeen, 0));
Hope this help to someone
Happens to me because I’ve done erratic camera movement.
In my situation, my camera was a child of a gameobject with a rigidbody with 0 mass, not only zero but that “infinity ZERO”.
After add a impulse to this rigidbody, it goes “to infinity and beyond” and this bugs camera’s ScreenPointToRay methods.
So a attempt solution is to analyse the camera movement.
Unity 2018.2.12f1 | Windows 10
None of the solutions helped my case but I fixed it by switching the “Target Eye” option of the camera to “None”
*I am developing a VR game
This occurred in my scene when I added a the Water4 prefab from Unity’s Standard Assets while using a camera with Projection set to Orthographic.