- Home /
Unity WebGL Error "Screen position out of view frustum"
I'm using a Unity WebGL app in a modal (dialogbox) of a website. As long as this modal isn't visible there is always this error in the console log: "Screen position out of view frustum". How can I handle or avoid this error?
Answer by FionNoir · Mar 19, 2018 at 08:36 PM
Ok, I've got a dirty solution for this issue in my case. I've written a function in Unity to disable my main camera. So every time I'm hiding the container with the Unity WebGL (modal or dialogbox), I'm going to call the function do disable the main camera from JavaScript and the error disappears. But I don't believe that this is the only way.
Just a quick update. here ist description of the solution that worked for me: https://stackoverflow.com/questions/49335738/hidden-unity-webgl-app-screen-position-out-of-view-frustum/49459561#49459561
Answer by Kik24 · Mar 21, 2018 at 04:13 PM
Hi,
I've been getting the same error since I updated to Unity2017.
My setup is the following: a ReactJS web application that features 2 Unity-generated WebGL renderers embedded in a tab of the ReactJS App.
What I observe:
A) After succesful initialization of the Unity WebGL content, the error starts overwlowing the browser console so long as the WebGL renderers remain "hidden" (in my case: in a not-yet-opened tab of the web application)
B) Errors stop as soon as the WebGL renderers are visible (ie: when I navigate to the tab hosting the WebGL renderers)...
C) ...and resume as soon as they become hidden again (e.g when I navigate-back to another Tab of the web application)
In other terms: this error seems to appear anytime the WebGL renderers are hidden, and stops as soon as they get visible.
=> this is the exact same behavior as described by @FionNoir (thank you for this, your post pointed me in the right direction!)
Note that,despite the errors popping wild, everything is still working fine and as it should, but the constant spamming of error messages in the Web console strongly impairs reactivity of the App.
I can also confirm that disabling the camera prevents the error, but manually enabling / disabling the camera is not an optimal solution, even if it will have to do for now.
I have checked the release notes of Unity 2017.2.1: Graphics: Emit error messages instead of assert when the screen position is out of view frustum.(947342)
=> this I why I wasn't getting this error before the upgrade to Unity2017
To the Unity development team: could you please have a look at this and disable this error message in case current renderer is hidden?
PS: I have, as suggested in other posts about this error message, also tried the following: modifying orthographic camera size, clip planes, untagging it, etc...
In my case nothing helps...the camera is fine and this is really only a problem about the Unity content being hidden.
Please fix this, thanks!
Your answer
Follow this Question
Related Questions
game view differs between devices in web 1 Answer
Scale Vertices propotional to Camera Frustum 0 Answers
Move Around in The Editor 1 Answer
turn off selection in the Scene View 0 Answers
i cant change my view 0 Answers