!IsFinite(outDistanceForSort)

Hi, I have an error that I cant seem to fix or find the cause and doesnt seem to always appear but doesnt seem to do anything weird when I run it in the editor.

!IsFinite(outDistanceForSort)
UnityEditor.Handles:Internal_DrawCamera(Camera, Int32)
UnityEditor.Handles:Internal_DrawCamera(Camera, Int32)
UnityEditor.Handles:smile:rawCamera(Rect, Camera, Int32)
UnityEditor.SceneView:OnGUI()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ])
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ])
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[ ], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[ ])
UnityEditor.HostView:Invoke(String)
UnityEditor.DockArea:OnGUI()

[…..\Runtime\Camera\RetainedRenderqueue.cpp line 334]

and this as well

!IsFinite(outDistanceForSort)
UnityEditor.EditorGUIUtility:RenderGameViewCameras(Rect, Rect, Boolean, Boolean)
UnityEditor.EditorGUIUtility:RenderGameViewCameras(Rect, Rect, Boolean, Boolean)
UnityEditor.GameView:OnGUI()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ])
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ])
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[ ], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[ ])
UnityEditor.HostView:Invoke(String)
UnityEditor.DockArea:OnGUI()

[…..\Runtime\Camera\RetainedRenderqueue.cpp line 334]

Hi, I’m having the same problem; when I start to get that error in the console my character starts falling through the ground and gets lost to infinity…

Do you get any other odd behaviour in your game when you start to get those messages ? And… did you find a solution the the problem ?

I also filed a bug report to Unity but with no feedback.

Maybe if we exchange some info we can understand what is generating this problem…

are you moving too far away from the 0,0,0 point in the world?

I don’t know what you mean bytoo far away… The problem seems to happen only when the character moves on the Z axys and passes value 142 (more or less).

No odd behaviour when you move along the X axys (values 0 to 296).

The weird thing is that it seems that the whole physics system gets screwed up: I tried to place another plane with a collider below my normal playfield and the character falls through. It seems that from the moment you start getting those messages any collision is ignored…

I also have this problem. The error messages come in such vast quantities that the frame rate drops to about 10 FPS. It starts as soon as the scene is loaded (camera is in a fixed position staring at a wall with a few GUI options). We have no negative or infinite particle settings…and none of the stack traces lead back to any of our scripts.

EDIT: Update, this also continues to happen after we have stopped playing the scene and are just looking into the editor.

FUTHER EDIT: Oh, changing the depth of the camera from -1 to 0 fixed the errors in editor mode, and we found the culprit for the others. Don’t quite know the reason yet (something is bad about this piece of geometry since it also gaves invalidAABB errors) but will post more info later.

1 Like

I just managed to do this by setting localScale to a vector that contained a NaN, too.

hi - i’m getting a constant console spam of this error message when using TextMesh (3D Text)
!IsFinite(outDistanceForSort)
!IsFinite(outDistanceAlongView)
UnityEditor.DockArea:OnGUI()

This problem with 3D text has been logged in a bug report. However, in the meantime, you may be able to fix it by using Unicode for the Character setting in the font importer and/or changing the font size from the importer rather than the TextMesh component.

This one should be fixed in next release :wink:

cool, thanks guys! :slight_smile:

Setting the font size in the textmesh to 0 fixed it for me.

That’s really not a good solution. I may be using that font at various sizes throughout the application and you don’t want to have a texture specific to each size. That begins to eat up memory and inflate your game’s size on disk, which can be a real problem for iOS apps trying to stay under 20mb. You generally want to make one texture, that’s big enough so that the highest font size usage still looks good.

When divided by zero or NaN, then this error will come. The solution is to test the value of the divisor before calc it.

I still get this error in Unity 4.5.
The problem happens when I run a command using OnInspectorGUI()

   public override void OnInspectorGUI()
    {

        EditorGUILayout.BeginHorizontal();
        minusClicked = GUILayout.Button("-");
        plusClicked = GUILayout.Button("+");
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.BeginHorizontal();
        path.GeometryWidth = EditorGUILayout.FloatField("Width", path.GeometryWidth);
        CreatePath = GUILayout.Button("Create path geometry");
        EditorGUILayout.EndHorizontal();
        debug = EditorGUILayout.Toggle("Edit", debug);

        if (plusClicked || minusClicked)
        {
            if (path != null)
            {
                if (path.Points == null)
                {
                    path.Points = new List<Vector3>();
                    path.Rotations = new List<Quaternion>();
                }
            }
            if (plusClicked)
            {
                if (path.Points.Count != 0)
                {
                    path.Points.Add(path.Points[path.Points.Count - 1] + new Vector3(1, 0, 1));
                    path.Rotations.Add(path.Rotations[path.Rotations.Count - 1]);
                }
                else
                {
                    path.Points.Add(Vector3.zero);
                    path.Rotations.Add(Quaternion.identity);
                }
            }
            else if (minusClicked)
                if (path.Points.Count != 0)
                {
                    path.Points.RemoveAt(path.Points.Count - 1);
                    path.Rotations.RemoveAt(path.Rotations.Count - 1);
                }
        }
        if (CreatePath)
        {
            if (path != null)
                CreatePathForPoints(path.Points.ToArray(), path.GeometryWidth);
        }
        DrawDefaultInspector();
    }
 void OnSceneGUI()
    {
        if (path == null)
            path = target as AramPath;
        if (path != null)
        {
            if (path.Points == null)
            {
                path.Points = new List<Vector3>();
                path.Rotations = new List<Quaternion>();
            }
            if (debug)
            {
                if (Tools.current == Tool.Move)
                    for (int i = 0; i < path.Points.Count; i++)
                    {
                        path.Points[i] = Handles.PositionHandle(path.Points[i], Quaternion.identity);
                        //Handles.Label(path.Points[i], path.Points[i] + "");
                    }

                for (int i = 0; i < path.Points.Count - 1; i++)
                    Debug.DrawLine(path.Points[i], path.Points[i + 1], Color.green);
            }
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
            SceneView.RepaintAll();
        }
    }

I’d started to get these when I changed Line Spacing to zero in a Text component (4.6+ GUI System), changed back to 1 and the spam goes away.

In our case the culprit was the “rich text” checkbox of Text component (Unity >=5) using dynamic font, disabling it stopped these errors to appear.

In our case it was caused by a rect UV of (0,0,1,-1) on a RawImage, changing it to (0,0,1,1) (and flipping the texture externally) stopped the errors (thousands of them per frame).

Version 5.3.1p3 (= Patch Release 3) solved my issues.

I’m in a project which has no text whatsoever, and get the errors isFinite(d), isFinite(outDistanceAlongView), isFinite(outDistanceForSort). They pop up when an instantiated rocket-prefab collides with a terrain object tagged “Ground”, resulting in an instantiation of an explosion-particlesystem-prefab, and then Destroy() on the rocket.

Stuffing a small Destroy() script on the particlesystem stops the errors occurring as soon as the system’s removed. Just wanted to add that to the list here, since nobody seems to’ve bumped into it with a particlesystem

1 Like

I am having this with a particles system as well… What does your “destroy” script do? any what exactly is causing the issue?