"Screen position out of view frustum"

Hello,

I started a new project in unity recently. For now, it only has a camera, a script (attached to the camera), and two cubes.
Yet I already have the infamous “Screen position out of view frustum” error EVERY time I start unity. To be more precise, here’s the exact error message
Error Message

Screen position out of view frustum (screen pos 0.000000, 0.000000, 100.000000) (Camera rect 0 0 0 0)
UnityEngine.Camera:ScreenToWorldPoint(Vector3)
cameraGizmo:OnDrawGizmos() (at Assets/RMAssets/Scripts/Misc/cameraGizmo.cs:17)
UnityEditor.DockArea:OnGUI()

I’ve been searching all around for explanation. But all I could found was “meh it’s an editor bug, just don’t mind it. They’ve never been able to reproduce it”.

So my questions are: Does this bug has been tracked down yet? If not, should I / How do I give a copy of my project to unity devs?

By the way, here’s the script file attached to the camera, I only use it to print the camera field of view (not the full frustrum because I’m working on a 2D game):

using UnityEngine;
using System.Collections;

public class cameraGizmo : MonoBehaviour
{
    Camera cam;

    void Start()
    {
        Gizmos.color = Color.white;
    }

    void OnDrawGizmos()
    {
        Camera cam = this.camera;

        Vector3 blPoint = cam.ScreenToWorldPoint(new Vector3(0, 0, cam.farClipPlane));
        Vector3 brPoint = cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, 0, cam.farClipPlane));
        Vector3 tlPoint = cam.ScreenToWorldPoint(new Vector3(0, cam.pixelHeight, cam.farClipPlane));
        Vector3 trPoint = cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, cam.pixelHeight, cam.farClipPlane));

        Gizmos.DrawLine(tlPoint, trPoint);
        Gizmos.DrawLine(trPoint, brPoint);
        Gizmos.DrawLine(brPoint, blPoint);
        Gizmos.DrawLine(blPoint, tlPoint);
    }

    void OnDrawGizmosSelected()
    {
        Gizmos.color = Color.red;
        OnDrawGizmos();
    }
}

Thanks for reading. Any help would be appreciated.

Actually, I don’t believe that issue is the same as the editor bug that we’ve all been experiencing. Yours is directly related to your code. I would suggest adding or subtracting some number from your cam.farClipPlane, cam.pixelWidth, and cam.pixelHeight values.

You are obtaining the far points for the view frustrum and attepting to get the values for those far points using ScreenToWorldPoint, however the values of those far points are just at the edge of the view frustrum. If you adjust the value by somehing like 0.01f, then you’d be bringing those values in just under the view frustrum.