Search Unity

Assertion failed: Assertion failed on expression: 'CompareApproximately(SqrMagnitude(result), 1.0F)'

Discussion in 'Scripting' started by LesBloom, Aug 23, 2017.

  1. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    Hi all,

    I am getting this error spamming about once per frame.

    Last weekend I upgraded to 20171.0f3 from 5.5.1p2, and worked for the full day with no issues. Today I boot up Unity, launch my scene, and I immediately start getting this error spam.

    I have no local diffs of any kind. I have tried restarting Unity. I have loaded every scene in my project (credits, title screen, game, etc), and they all cause this error.

    There is no call stack with the error. It's displays exactly and only what I put in the post title.

    Some searching suggested it's commonly associated with bad transform values, but it is happening in all of my scenes, 100% of the time. I am totally clueless where to start looking. Any information would be much appreciated.

    Thank you for your time

    Oh, and this is a VR game, in case that might matter.
     
    Project_8818 and imyueli like this.
  2. Project_8818

    Project_8818

    Joined:
    Dec 10, 2015
    Posts:
    2
    Hello funnersoft,

    Just wanted to say that I'm also experiencing the same issues you seem to be having.
    I had been using unity version 2017.1.0f3 for about a week without problems, however, when I booted up my VR project today I got spammed the same error. Unfortunately, I haven't been able to solve the problem but I have noticed that disabling the openVR sdk in player settings stops the error for appearing; so the root of the error might be there. I'll let you know if I find any more information; also if you manage to find a solution to the problem I'd appreciate it if you let me know as well.

    Thank you,
     
  3. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    A coworker with a Vive ran into this same issue. He made the issue go away after upgrading to the latest SteamVR beta.

    Since I'm an Oculus user, I never saw this issue, so YMMV.
     
    Project_8818 likes this.
  4. Project_8818

    Project_8818

    Joined:
    Dec 10, 2015
    Posts:
    2
    Thank You BlackPete,

    That seemed to do the trick. After removing the openVR sdk from player settings, deleting the SteamVR plugin content folders, reinstalling the plugin, and restarting unity; I was able to run my project without any errors.
    Hopefully, this fix will work for you as well funnersoft.

    Good Luck,
     
  5. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    Thank you BlackPete and Project_8818 for the information.

    I am in the process of updating SteamVR to 1.2.2. Sadly the update wasn't compatible with a lot of my project, and it introduced a new set of problems to fix.

    My project does compile though, and I still get the SqrMag error that this post is related to :(

    I am going to focus on the new set of issues that came with the SteamVR update, and hope that the SqrMag errors disappear after that.

    Thanks
     
  6. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    I am not sure what is going on with this error.

    I was working on updating all my 3rd party libraries. Trying to get them compiling and working together. Update hell. Finally got to a sort of working point; only to find the error was still spamming. Then, at some point, it just stopped. All of these updates are in a different branch.

    I then went back to my master branch (without any of these updates, but still Unity 2017.1.0f3), and the error is not happening anymore.

    No clue =/
     
  7. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    Probably something funny with SteamVR that eventually corrected itself through updates?

    Either way, glad to hear the error went away!
     
  8. LiFuZhou

    LiFuZhou

    Joined:
    Sep 18, 2017
    Posts:
    1
    Thank you for you guys.I also develop my project with SteamVR Plugins,and I am just experiencing the error,fortunately,I may try some ways of you to deal with this problem,Good luck to me!Thanks!
     
  9. ZhaoJiawei2333

    ZhaoJiawei2333

    Joined:
    Mar 23, 2018
    Posts:
    1
    I also encounterd this problem recently. In fact, it is simply caused by a NaN variable in your code. Use Debug.Log to check if some value is invalid
     
  10. vgp123

    vgp123

    Joined:
    Dec 29, 2018
    Posts:
    1
    this reply get the point. It happens when some variable is too large.