Search Unity

Unity 5.3.1f1 - Particle system errors - Invalid AABB result / IsFinite(d)

Discussion in 'Editor & General Support' started by gonzorob, Dec 18, 2015.

Thread Status:
Not open for further replies.
  1. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Your error is nothing to do with particles. Its the aabb. Is finite is nothing specific to particles. It just means the aabb values are invalid
     
  2. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Yeah. I know it has nothing to do with particles. I posted here because the error is the same. And I was told to file a bug report which I did. And I have no idea what aabb values are. Anyway clicking the error message does nothing, nor gives any idea of where the error is.
     
  3. MikeGameDev

    MikeGameDev

    Joined:
    Dec 28, 2012
    Posts:
    19
    Is there anyway I get tell Unity to stop outputting this error to the console? My stuff works fine but I'm getting really poor performance because of the constant console outputs. See the attached image.
     

    Attached Files:

  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    No you can not disable the message. Chances are things won't be working fine if you have this error. Your AABB is messed up which will affect things such as culling and shadows.

    Try this script, it will draw the AABB. The AABB should encapsulate the mesh.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowBounds : MonoBehaviour
    5. {
    6.     void OnDrawGizmos()
    7.     {
    8.         Renderer r = GetComponent<Renderer>();
    9.         if (r)
    10.         {
    11.             Gizmos.color = Color.yellow;
    12.             Gizmos.DrawWireCube(r.bounds.center, r.bounds.size);
    13.         }
    14.     }
    15. }
    16.  
    Like so:

    upload_2016-3-23_16-58-2.png

    You can change the bounds for your mesh manually like this:
    Doing so should stop the isFinite message
    Code (CSharp):
    1.         var mf = GetComponent<MeshFilter>();
    2.         mf.mesh.bounds = new Bounds(transform.position, new Vector3(10, 5, 1));
    3.  
    Alternatively you can tell Unity to calculate the bounds Mesh.RecalculateBounds.

    From what i can remember you said you were only assigning vertices. The bounds is only recalculated when assigning the triangles. So simply calling RecalculateBounds should be all you need to do after changing the verts.
     
    Last edited: Mar 23, 2016
    Fibonaccov likes this.
  5. MikeGameDev

    MikeGameDev

    Joined:
    Dec 28, 2012
    Posts:
    19
    That was a really good tip, thanks! I've fixed my problem, the AABB wasn't drawing and mesh.RecalculateBounds wasn't helping. I set the bounding box to be huge (size of 10000 units on each axis) and the error message went away.

    I could calculate the extents of the bounding volume based on the vertices, but since I have about a million of them, I'll settle for my solution.

    Went from 20 fps to over a hundred!
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Great :D
    Just make sure the bounds are too big rather than too small or things may disappear when near the edge of the screen(culling).
     
  7. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,051
    We have just started encountering this (these?) issues.
    It started with 5.1.4f1 and 5.1.4p1. I was able to work around them (mostly) by restructuring the order and usage of the sub-emitters. I pulled out the particle systems and created a repro project in 5.3.4f1 to see if it was just our version, and the problem resurfaced.
    Screen Shot 2016-03-31 at 1.59.27 PM.png
    We will submitting project/report with the work arounds I came up with in the near future.
     
    karl_jones likes this.
  8. normand

    normand

    Joined:
    Mar 18, 2014
    Posts:
    11
    I have 4000 error (Invalid AABB a)+++(IsFinite(outDistanceAlongView))++++(IsFinite(outDistanceForSort))on One simple FireWork form the standard asset. And its freaking my game. What sould I do? Stopping creating my game until it'll be fixed. Just for one particle problem. Where can i found the error number???
     
  9. normand

    normand

    Joined:
    Mar 18, 2014
    Posts:
    11




    Same Error like me on a simple Firework:(
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Which firework asset are you referring to? Is it on the asset store?
    If you could submit a bug report with the project or point me towards the asset I can take a look.
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Thanks I will take a look.
     
  12. Alwaysusa

    Alwaysusa

    Joined:
    Oct 3, 2015
    Posts:
    6
    Here's a potential fix I found for our game (particles in 2d world space with collision):

    don't use a float for your bounce value, use an int.

    Hope that helps if you happen to be in the same boat.
     
  13. tuamy

    tuamy

    Joined:
    Jan 16, 2016
    Posts:
    1
    What library?
     
  14. Silver783

    Silver783

    Joined:
    Jul 28, 2015
    Posts:
    1
    I fixed the problem when I deleted all the "LOD group" component of the objects of my scene. :)
     
  15. RV1

    RV1

    Joined:
    Nov 18, 2012
    Posts:
    68
    I upgraded to Unity 5.3.5p3 since I noticed it included a bunch of particle system fixes. Unfortunately I'm still getting the dreaded Invalid AABB errors although they seem like they are being spat out much less frequently (this could just be a coincidence however).

    As always they seem to originate solely from a particle system where I manually emit particles and use SetParticles/GetParticles.
     
  16. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    I'm still getting it. *sigh*
     
  17. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    If you still have the problem please file a bug report with the project so we can look into it.
     
  18. kippllo

    kippllo

    Joined:
    Jul 15, 2016
    Posts:
    1
    I had the error aabb.IsFinite() as well, I fixed it by putting the scale of the Particle System to 1 on x,y,z.
    Don't know if that will help, but it fixed it for me.
     
  19. Kiefy

    Kiefy

    Joined:
    Dec 11, 2016
    Posts:
    8
    I just got flooded with these Invalid AABB, IsFinite() errors in 5.5.0f3 while testing the results after part 7 of the tanks tutorial. Every time the game restarts after a win and it re-enables the movement script on all the active tanks (4), you briefly see a flash of the particle smoke on all tanks as each script Awake()'s.

    I was able to avoid the errors and particle glitch by keeping the movement scripts always enabled and controlling the active state with a bool instead.
     
  20. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Could you file a bug report please?
     
  21. jonny2027

    jonny2027

    Joined:
    Jul 16, 2013
    Posts:
    61
    Just so you are aware I am also seeing this in 5.6.0b3 I am trying to track down where the issue is coming from.
     
  22. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    What does the message say? invalid AABB is not a particle system specific issue but just means the bounds of an object are invalid.
     
  23. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The problem is that those "AABB-errors" almost never tell you what caused them. I have just upgraded a project from 5.4.3p3 to 5.5.0p3 and am haunted by this annoying issue once again.

    I have 999+ messages like that in the console. They don't ping any object in the scene and only very sporadically they point to some code. I have a whole set of bug reports on the bug tracker complaining about error messages like that and very likely, at least one of them points to this one. I believe doing a full text search in the Unity source code and making sure that every instance of "Invalid AABB" will generate a useful, actionable error message instead of just spamming the log with almost useless info (well, at least it got me here, so it was a little useful) ... would help a lot ;-)

    I'd love to file a bug report - but it's a huge project (40 GB), and as the error message doesn't give me much of a hint what's causing this, it's very hard to create a simplified repro-project.

    So what I'm getting (and I am literally posting all the info Unity gives me here):

    Code (csharp):
    1. Invalid AABB aabb
    2. Invalid AABB *this
    3. Converting invalid MinMaxAABB
    4. Invalid AABB result
    5. Invalid AABB a
    => that last one 3 times

    Code (csharp):
    1. Assertion failed on expression: 'IsFinite(d)'
    2. Assertion failed on expression: 'IsFinite(outDistanceForSort)'
    ... so ... "outDistanceForSort" sounds like it might have to do with particles but that is just a wild guess. We are using particles. Plenty.

    Code (csharp):
    1. Assertion failed on expression: 'IsFinite(outDistanceAlongView)'
    2. Invalid AABB aabb
    3. Invalid AABB rkBox
    => those last two once more

    FINALLY one that's useful:

    Code (csharp):
    1. Invalid AABB aabb
    2. UnityEngine.Transform:set_localScale(Vector3)
    3. FlyingNote:AnimatePassivePhase() (at Assets/_Holodance/Scripts/MidiControl/FlyingNote.cs:1096)
    4. FlyingNote:FixedUpdate() (at Assets/_Holodance/Scripts/MidiControl/FlyingNote.cs:722)
    So the code that triggers this is:

    Code (csharp):
    1. transform.localScale = originalScale * (1 - timeFrac * 0.8F);
    I'm assuming that this ends up being Vector.zero or maybe even something negative. Need to debug to know for sure. Which I did, and as far as I can tell, it's totally random, with one instance of a prefab with scale (0.9, 0.9, 0.9) triggering that specific message and 20 others not triggering it. Besides, it's apparently only one cause: Commenting out that line removes that specific message but the others are still there.

    Plus ... even when this gives me a StackTrace, instead of being an actual exception that I could catch and give myself some nice logging statement with relevant debugging information it's apparently some sort of internal error that I cannot catch (well, admittedly, that's obvious from the error message).

    The issue disappears when I disable all particle systems, so in this case it definitely has to do with particles. As Unity doesn't tell me which object is causing the issue I manually went through a few and checked the bounds and all of the seem reasonable (covering the area where there are particles). One thing that does seem odd is that in my current paused frame, there's two "trails" of particles that lead to somewhere where those objects definitely were not supposed to be (very far to the left, there is no code that would put them there, and physics also wouldn't for any good reason).

    ... ... ...

    So ... after spending almost a day debugging this (thanks Unity :-/ ), I found one particle system that apparently has no bounds. I had disabled my scaling code, and this particular one does not have any scaling on it.

    The particles looked normal until I deactivated and re-activated the object (that made the particles disappear ... which is expected). Nothing about this object looks weird except the particle system had "no" bounds, and doing anything with it spams the console with error message.

    Interestingly, next time I tried, I wasn't able to find an object like that (but the console was spammed again right before I hit pause).

    Filed a bug report, that's (Case 868801) Unity spams console ...
     
    Last edited: Jan 9, 2017
    sand_lantern likes this.
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    outDistanceForSort and outDistanceAlongView are both part of the Camera render loop. Its an indication that one of the objects has an invalid bounds but whatever caused this issue will be somewhere else.
    We do have plans to improve all error messages like this so they are clearer about the issue.

    Unfortunately those error messages dont point to any specific code, its all general AABB stuff.
    Setting the local scale will trigger the error when it tries to adjust the AABB, so it's possible that what is attached to the transform may have the issue.
    Its possible there was an issue upgrading a component(maybe particles) when you changed versions. Its hard to say without seeing the project or a reproduction.
    If you have a particle system without a bounds(which has more than 0 active particles) then that sounds like a possible problem.
    See if this helps create a smaller repro: https://blogs.unity3d.com/2016/08/24/attaching-your-project-to-a-bug-report/
    If it does not we can take a 40gb project, we can provide you with details on how to upload if you wish.
     
    MoonJellyGames likes this.
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ah, I see. So at the time the error occurs, there's really no reference to the object that's causing this available anymore and it would create a huge overhead (if even possible ;-) ) to keep that information available at that point in time. Tricky.

    Maybe a kind of "debug-mode" that can activated which would visualize the object creating the issue could work.

    I've tried deleting the library folder and re-importing everything, which sometimes fixes issues like that - but the issue persists. It's a bit strange because this is all using the same prefab as far as I can tell but I'll do some more investigation and see if I can send a reduced repro-project.
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
  27. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Oh, cool. Thank you! I never saw that - will try :)
     
    karl_jones likes this.
  28. SmartCarrion

    SmartCarrion

    Joined:
    Jul 27, 2013
    Posts:
    27
    I'm getting this invalid AABB error now too, I'm pretty sure it started when I upgraded to 5.5. I'm able to reproduce it on code that has been stable for months. Should I submit a bug report? I can't tell if it is causing any real problems except polluting the log.

    If I have tracked it down correctly, it happens when I activate some pooled particle systems for the first time. Should i be making some call to update the bounds? Did this used to be automatic and is no longer done or something?

    Thanks for your advice!
     
  29. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    No you should not be getting those errors. Please submit a bug.
     
  30. phasiclabs

    phasiclabs

    Joined:
    Nov 13, 2013
    Posts:
    126
    I've just got this when upgrading an older project from 5.3.4p4 to 5.5.0p3 - it spams the console relentlessly. I'll look into submitting a repro soon, but I'm a bit busy at the moment, and our project is massive and will need trimming down.
     
  31. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    985
    I can confirm the same problem occurs in my project.

    Just updated from 5.3.4 to 5.5. It appears to originate from an entity that uses particles and is recycled from a pool. I tried deactivating the particles in the prefab but oddly enough, when I recycle from the pool, the particles become active again. There is no code in my system that would cause this to happen. If I remove the particle system from the entity altogether, the errors stop.

    I will try to strip it down to a bare-bones scene that can demonstrate the issues but it will likely be a day or so.
     
    richardkettlewell likes this.
  32. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I've just seen this in the 5.5.1p1 release notes:
    • Particles: Fixed issue where particle bounding boxes could become corrupted, resulting in "Invalid AABB" messages
    Unfortunately, the link to the bug entry (868648) doesn't work ... but I'll give that version a try, sounds very promising because at least in our case, this is apparently exactly what had happened :)
     
  33. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    985
    Just tried version 5.5.1p1 - the bug still appears to not be fixed. I'm having trouble coming up with a simplified test scenario so I may end up just sending my whole project with the error report.
     
  34. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I believe one problem with those errors is that they have different causes. In my project, the error is gone - and it was previously very easy to reproduce, so I'd say the issue I ran into is fixed.

    There's another issue related to particles that I'm running into, though: It seems like the position of the particle system is offset frequently for a brief moment. I need to look deeper into this, all I know at the moment is that it does happen in 5.5.1 but not in 5.4.3 ... it's probably not even related to this thread but I felt it's okay to mention it in this context.
     
  35. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    There keeps being bug after bug after bug that shows this symptom. Something somewhere - either in a model import or in a particle system or in whatever - gets a NaN or Infinity value somewhere, and the console goes haywire with AABB errors.

    These bugs are always hard to track down. And it's really discouraging to send bug reports since it doesn't seem like the class of problems will ever be fixed.

    It would help a lot if you guys did an effort to improve the error messages for this. Kill off the "Assertion failed on expression: 'IsFinite(d)'" and "Invalid AABB aabb" and "Converting invalid MinMaxAABB" assertions and errors, and give us an error that tells us which object is messed up. That would help us immensely with hunting down what's happening, and actually give us the ability to send good bug reports.

    My level designer just got this kind of error spam when killing an enemy. There's tons of particle systems and screen effect and stuff firing, and it's not a consistent bug, so there's no way for me to figure out what's going on.
     
    ArachnidAnimal likes this.
  36. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    243
    I'm getting the same error on 5.6.0f3. It happens when my particle system is set to world, but not when I set it to local. Unfortunately I do need world. It happens randomly for me so its not easy to reproduce, but does happen eventually. The only that changes in my app is I turn on the particle system or turn it off, I don't scale it or anything.
     
  37. JordanW

    JordanW

    Joined:
    Jun 15, 2013
    Posts:
    1
    This error has been around for quite some time, and doesn't seem to be going away.

    Is there any way that users can simply check AABB.isValid() ? Without having to wrap try/catch/etc. etc. or watching it just fail randomly?
     
  38. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    The error is a symptom of other problems. Many of the AABB errors are caused by different issues. The issues that this post started with have been fixed for a long time now. If you get AABB issues do please file bug reports so we can investigate what is causing them and address it.
    We have made improvements to many of the AABB error messages so they should give more information on what is causing the problem.
     
  39. restaste

    restaste

    Joined:
    Aug 21, 2013
    Posts:
    3
    Reviving an old issue: FWIW, I just had this issue happen when upgrading a project to a newer Unity version (5.5.1 to 5.6.2).

    My solution: Shuriken's "shape" module, when set to "cone" has an "arc" value that was set to NaN during the import. Setting it to 360 fixed the problem.
     
    JasonNiapVS likes this.
  40. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Just hit this today as well, Arc = NaN, upgraded an old project, and some of the particles were causing massive slowdowns. Maybe something that can be fixed editor-side?
     
    Last edited: Aug 18, 2017
  41. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    We have some upgrade fixes in the next patch that may solve this, they are related to prefabs.
    What version did you upgrade from and to?
     
  42. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    I believe it was 5.6.2, but could be wrong, not exactly sure when the error began.
     
  43. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Can you try 5.6.3p2 when it is released, it should be out by Friday.
     
  44. Contato

    Contato

    Joined:
    Oct 2, 2015
    Posts:
    16
    Hi, I'm experiencing Invalid AABB too, but my case could be a little more interesting, because I am creating meshes via script.
    If I create a mesh and use it on a MeshRenderer it is fine, bounds are great, object seems perfect.
    But If i use it on a SkinnedMeshRenderer then my editor gets a flood od AABB errors, bounds are NaN and -Infinite.

    If I dont add a bone to the SkinnedMeshRenderer then the object is fine, no AABB errors. The problem is only if I create a bone via script.

    How am I creating this one bone for the entire object?

    1) add the transform to bone and set it's parent;
    2) add a bindpose as: newBones [boneIndex].worldToLocalMatrix * transform.localToWorldMatrix
    3) add the boneweights:
    Code (csharp):
    1.  
    2. BoneWeight[] boneWeights = new BoneWeight [tempMesh.vertexCount];
    3. for (int i = boneWeights.Length; i < tempMesh.vertexCount; i++) {
    4.    boneWeights [i].boneIndex0 = 0;
    5.    boneWeights [i].weight0 = 1;
    6. }
    7.  
    4) add everything to their renderer
    5) Recalculate bounds just for the sake of it

    Funny thing is, if I use my code to copy create a SkinnedMeshRenderer and all its bones based on another model then everything works.
     
  45. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Please file a bug report.
     
    Contato and richardkettlewell like this.
  46. Contato

    Contato

    Joined:
    Oct 2, 2015
    Posts:
    16
    I didn't open a new bug because it was my mistake, in my main process the boneweights where receiving 0 as weight.
    But anyways, it's confusing because it wrecks the bounds.

    Thanks.
     
    karl_jones likes this.
  47. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    With a bug report, it may be possible for us to add a clear and obvious error message in the appropriate place, even if the mistake was in your code :)
     
    karl_jones likes this.
  48. Contato

    Contato

    Joined:
    Oct 2, 2015
    Posts:
    16
    Alright, done!
    (Case 946809) AABB errors when boneweights are zero
     
    karl_jones and richardkettlewell like this.
  49. sebastiansgames

    sebastiansgames

    Joined:
    Mar 25, 2014
    Posts:
    114
    Hi -- I'm also getting strange AABB errors and crashes. I've filed a couple bug reports. Thank you! Case: 947381 and 947412.
     
  50. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Those errors dont look related to particles or the issues in this thread. The bug is with QA so they should be able to identify the problem.
     
Thread Status:
Not open for further replies.