Search Unity

Assertion failed on expression: 'IsNormalized...

Discussion in 'Physics' started by MrEsquire, Apr 27, 2017.

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

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I upgraded a game Unity 5.6patch3, but there is a new unity big created, in process of debugging I got this:

    Assertion failed on expression: 'IsNormalized(dir)'
    UnityEngine.Physics:Linecast(Vector3, Vector3)

    and:

    Assertion failed on expression: 'IsNormalized(ray.GetDirection())'
    UnityEngine.Physics:Linecast(Vector3, Vector3)

    I dont think its related to my issue,but interesting to know what it means?
     
  2. Glurth

    Glurth

    Joined:
    Dec 29, 2014
    Posts:
    109
    It sounds like unity is expecting a particular vector to be of magnitude 1 , but it's not. ( a "normalized" or "normal" vector is used to define a direction but NOT a distance, wich is why it always has a magnitude of 1) I can only assume you are somehow passing a vector to the physics engine that it expect to be a normalized vector, but it isn't.

    Physics.Raycast's second parameter is an example of a vector unity probably expects to be normalized. Though I think that function WILL work with a regular vector, it will probably normalize it internally, which COULD cause a performance hit.
     
  3. Poon-Moon

    Poon-Moon

    Joined:
    Jan 27, 2015
    Posts:
    8
    Popping and answer in as I had same issue as OP and not caused by the responses mentioned so far. The issue for me was that the camera had a 'Flare Layer' component on it. When I unticked that, the messages stopped.
     
  4. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    247
    Thank you!
     
  5. gregrgay

    gregrgay

    Joined:
    Nov 2, 2021
    Posts:
    1
    Same issue for me. Disabling the Flare layer on the FPSController resolve the issue for me as well.
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    Please don't necro old threads like this, it's what the like button is for!

    Let's close this non-physics related thread.
     
Thread Status:
Not open for further replies.