Search Unity

!IsFinite(outDistanceForSort)

Discussion in 'Editor & General Support' started by fyrlandt, Jan 22, 2010.

  1. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Just a note, for anyone using Suimono who's experiencing this error there is a patch available that fixes this. Send me a PM or email and I'll get it to you.

    I've seen this issue in 5.3.1+ sporadically. Though the error may not be exclusive to particles, it is certainly normal particle systems causing it to fire in all cases I've seen. It seems to be due to particle systems attempting to be rendered without emitted particles in them... which has never been a problem in Unity before. To get around this bug you can try logging the number of particles in the particle system, and then shutting down the particle renderer if they fall below a certain number... for example....
    Code (CSharp):
    1. //manage particle systems
    2. if (myParticleComponent != null){
    3.     #if UNITY_5_3
    4.         if (myParticleComponent.particleCount <= 2){
    5.             myParticleRenderComponent.enabled = false;
    6.         } else {
    7.             myParticleRenderComponent.enabled = true;
    8.         }
    9.     #else
    10.         myParticleRenderComponent.enabled = true;  
    11.     #endif
    12. }
    you may need to experiment with the lowest particle count number, as in my experience it isn't always at 1 or less. Sometimes (perhaps depending on how fast the particle systems run?) you'll need to set the lowest number of particles to 10 or higher. Good luck people!
     
  2. Mark-Sweeney

    Mark-Sweeney

    Joined:
    Feb 21, 2010
    Posts:
    172
    I'm getting this issue in Unity 5.3.2p4 as well.
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    If you are using water or reflections then you may still get the problem. A fix is on the way, should be in the next week or two.
     
    KEMBL likes this.
  4. Mark-Sweeney

    Mark-Sweeney

    Joined:
    Feb 21, 2010
    Posts:
    172
    I am using reflections. It only happens after particles fire. Going to try a pool manager and script to turn off particles after they've fired, as per chingwa's post.

    Nope, that didn't do it. But the particle pool manager always helps anyways.
     
    Last edited: Feb 23, 2016
  5. Mark-Sweeney

    Mark-Sweeney

    Joined:
    Feb 21, 2010
    Posts:
    172
    5.3.3f1 fixed the issues I was having <flails arms wildly>

    Thanks!
     
    karl_jones likes this.
  6. Karsten

    Karsten

    Joined:
    Apr 8, 2012
    Posts:
    187
    for us the error still appears in 5.3.3f1 :/
     
  7. Leon-Reis

    Leon-Reis

    Joined:
    Sep 1, 2014
    Posts:
    8
    Hello Unity . I am getting this error too . on early version was all ok. I am importing Avatar from Blender. And no matter what format is, Blender File , FBX , or Collada . I get this error every time when i put the Avatar at the scene .When we will get a patch Fix ? Thank you
     
  8. Leon-Reis

    Leon-Reis

    Joined:
    Sep 1, 2014
    Posts:
    8
    Guys as i told , i was using a importing a avatar from blender. My avatar have Morphs,and i cut my avatar in 5 parts. And i tested the morphs and one of 5 parts have a huge bug. I checked on Blender and the problem came from the Blender. I rework my Avatar , and reCuted again. I tryed now , and ALL is Working. So I guess this error sujest a Morph Error. After i fixed my Avatar , morphs and cuts , all is working pretty nice without errors. I hope to help you.
     
  9. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    I'm using 5.3.2p2, keep getting IsFinite(outDistanceForSort) UnityEngine.Camera:Render().
    Always when water / reflections are involved.
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Try the latest patch version, this should be fixed.
     
  11. 7DSFinch

    7DSFinch

    Joined:
    Jul 30, 2013
    Posts:
    10
    Still having this problem with 5.3.3f1. Only with water/reflections.
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Try 5.3.4
     
  13. 7DSFinch

    7DSFinch

    Joined:
    Jul 30, 2013
    Posts:
    10
    Looks good in 5.3.4f1!
     
    karl_jones likes this.
  14. revixter

    revixter

    Joined:
    Dec 3, 2015
    Posts:
    1
    I recently started having this error 3-4 days ago. The only changes made to my game prior to receiving the error were text meshes now scale with camera distance, and a couple particle effects were added. My friend and I play the game roughly 1-2 hours a day to "test" and something seriously wrong is still going on.

    Prior to 5.3.4, it would crash a built version of the game anywhere from 5-15 minutes in. If run through the editor, instead of crashing I would receive the isFinite error and my frame rate would tank (from 160 or so down to 12, seemingly getting progressively worse).

    Now after 5.3.4, the same thing still happens, but it takes a lot longer to happen. Instead of happening within 15 minutes, it now happens after 1-2 hours. The built version still crashes but now when running through the editor I will no long receive the isFinite message, however the frame rate will tank as it had before. I made absolutely 0 changes to the game from 5.3.3f to 5.3.4. I'll send you my project if you want, takes a while for it to happen but it always happens eventually.
     
  15. GameDevRick

    GameDevRick

    Joined:
    Oct 8, 2011
    Posts:
    269
    I don't know exactly what is causing it, but I suspect it has to do with the orthogonal scene camera.
    When I toggle to 3d in the scene view during run time, the error disappears.
     
  16. ikriz

    ikriz

    Joined:
    Dec 3, 2009
    Posts:
    98
    Console was reporting this error for me aswell in Unity 5.3.5f1, turned out i'd forgotten a disabled particle system in a loaded scene, wasn't using the particles anyway so completly removed them from the scene and it now works.

    [edit]
    I take that back the error is still popping up exact error is: "IsFinite(outDistanceForSort)" without the exclamation mark.
    [/edit]
     
  17. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    In 2D both this and the Out of view frustum errors happen mode frequently, but still can get with 3D camera when is is aligned in certain angle. My guess is that there is some infinite check that must go in for both these, something is created very far away in particles is my guess and a render in infinte point could also make it happen.
     
  18. Saturn1004

    Saturn1004

    Joined:
    Nov 14, 2014
    Posts:
    42
    Still experiencing this bug in 2020.3.24f1.
    Seems to be related to changing an actual prefab at runtime. (Like modifying a saved prefab in a folder somewhere at runtime.)
    Sometimes after modifying it, it seems to have random data loss on the prefab, and the settings assigned on the scripts and position data will be all jumbled up and spaghettified, which leads to this error.
    Since it's a prefab of other prefabs I was able to get it to stop by reverting the prefabs within the prefab.
    I guess modifying the actual saved prefab at runtime is so rarely done it isn't thoroughly tested.
     
  19. krearthur

    krearthur

    Joined:
    Sep 12, 2010
    Posts:
    8
    Had the same error in 2021.3.5f1. It happened when changing the transforms parent of my player character.
    Seems there are multiple cases when this issue can occur.
     
  20. fapiro

    fapiro

    Joined:
    Nov 28, 2016
    Posts:
    4
    I found it in Unity 2021.1.22f. I spent few hours to found out what is wrong. For the convience I wrote the script bellow to find such error objects:

    SOLUTION: Use the following script to find all InvalidAABB objects in scene.
    Select in MainMenu "Tools/FindInvalidAABB" when errors occur while game is running in Editor (when all your objects are loaded from prefabs).
    Script also finds errors in inactive objects in scene.
    Take a look into Console window. Then change values of the Position or Scale in Inspector to fix it.

    CAUSE: position or scale value are invalid, for example like -4.019843e-11 or +6.26252e+29

    This solution has fixed errors:

    Invalid worldAABB. Object is too large or too far away from the origin.

    Invalid AABB a

    Assertion failed on expression: 'IsFinite(outDistanceForSort)'
    UnityEngine.GUIUtility : processEvent (int,intptr,bool&)

    Assertion failed on expression: 'IsFinite(outDistanceAlongView)'
    UnityEngine.GUIUtility : processEvent (int,intptr,bool&)

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.  
    3. using System.Collections.Generic;
    4. using UnityEditor;
    5. using UnityEngine;
    6. using Object = UnityEngine.Object;
    7.  
    8. namespace Editor.Helpers
    9. {
    10.     public class EditorFindInvalidAABB
    11.     {
    12.         [MenuItem("Tools/FindInvalidAABB")]
    13.         public static void FindInvalidAABB()
    14.         {
    15.             var invalidObjects = GetInvalidAABB();
    16.             if (invalidObjects.Count > 0)
    17.                 Debug.LogError($"Found invalidAABB: objects count {invalidObjects.Count}");
    18.             else
    19.                 Debug.Log("Not found invalidAABB");
    20.         }
    21.  
    22.         // Returns invalid objects with wrong scale: for example like -4.019843e-11 or +6.26252e+29
    23.         private static List<GameObject> GetInvalidAABB()
    24.         {
    25.             var result = new List<GameObject>();
    26.             var allObjects = Object.FindObjectsOfType<GameObject>(true);
    27.          
    28.             foreach (var obj in allObjects)
    29.             {
    30.                 var rectTransform = obj.GetComponent<RectTransform>();
    31.                 if (rectTransform != null)
    32.                     continue;
    33.  
    34.                 var position = obj.transform.position;
    35.                 var scale = obj.transform.localScale;
    36.              
    37.                 if (IsValueInvalid(position.x) || IsValueInvalid(position.y) || IsValueInvalid(position.z)
    38.                     || IsValueInvalid(scale.x) || IsValueInvalid(scale.y) || IsValueInvalid(scale.z))
    39.                 {
    40.                     result.Add(obj);
    41.                     Debug.LogError($"Found invalidAABB object {GetObjectPath(obj.transform)}");
    42.                 }
    43.             }
    44.  
    45.             return result;
    46.         }
    47.  
    48.         private static bool IsValueInvalid(float value)
    49.         {
    50.             return value < 0f;
    51.         }
    52.  
    53.         private static string GetObjectPath(Transform transform)
    54.         {
    55.             var result = "";
    56.             while (transform != null)
    57.             {
    58.                 result = transform.gameObject.name + "/" + result;
    59.                 transform = transform.parent;
    60.             }
    61.  
    62.             return result;
    63.         }
    64.     }
    65. }
    66.  
    67. #endif
    68.  
     
  21. hntb_adam

    hntb_adam

    Joined:
    Jun 28, 2023
    Posts:
    11
    I found another weird cause for this one... I had a Canvas as a child of an object, and when I scaled the object something weird happened with the Canvas scale/position. It turned out that switching to play mode is what ended up fixing it, since it somehow reset the Canvas size.
     
  22. Acreates

    Acreates

    Joined:
    Dec 12, 2016
    Posts:
    41
    Assertion failed on expression: 'IsFinite(outDistanceForSort)'
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Here from the future.
    2022.3.4f1

    Just started seeing this for the first time. Did not see it last night when I shut down the editor.
     
  23. Acreates

    Acreates

    Joined:
    Dec 12, 2016
    Posts:
    41
    2022.3.4f1 Hello from the future. I'm seeing this in a scene with all objects deactivated...it seems to be something inherent in the scene.
     
  24. fafase

    fafase

    Joined:
    Jul 3, 2012
    Posts:
    163
    Got this happening when we updated to 2022.

    Related to particle effect and cone shape with arc at 0. Changing to 0.01 and errors stop.
     
    Westland likes this.