Search Unity

Feedback BUG: ArgumentException: Object at index 0 is null

Discussion in 'Editor & General Support' started by cmann, May 20, 2019.

  1. cmann

    cmann

    Joined:
    Aug 1, 2015
    Posts:
    31
    I get this when hitting play.
    I found this: https://forum.unity.com/threads/201...recttransformeditor-i-used-refliction.603268/
    But it seems slightly different.

    I'm on 2019.1.0f2

     
  2. ColbySg89

    ColbySg89

    Joined:
    Mar 26, 2015
    Posts:
    15
    I would install the newest version of Unity 2019 and retest. Do you have Unity Hub installed on your machine?
     
    Joe-Censored likes this.
  3. cmann

    cmann

    Joined:
    Aug 1, 2015
    Posts:
    31
    Yes I have Unity Hub. I only installed recently so I didn't think to check for updates.
    I'll do that as soon as I can and check if the problem persists.
    In the future I'll make sure I'm on the latest version before posting here.

    A slightly related question: does unity not have an update mechanism for minor updates?
    It seems like I have to download the entire unity for each update, which can be a little inconvenient if your internet's not that reliable.
     
  4. ColbySg89

    ColbySg89

    Joined:
    Mar 26, 2015
    Posts:
    15
    From what I have read on Unity's site they will be providing three major updates in between their yearly updates i.e. Unity 2017.1-2017.3, to address the minor updates it seems like Unity Hub is their solution. I'm no expert on it since it is fairly new but you can have multiple versions of Unity installed now and choose them as needed. I don't usually update right as they come out but your error seems like something is missing from the core engine so updating may work for your scenario but you normally wouldn't have to update as soon as every update comes out especially the minor updates.
     
  5. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    603
    This should be a harmless bug, coming from many an hour working in the inspector, hierarchy window, etc. This is a Unity only bug, and is caused by the Editor Windows logic layer (separately running from the main game logic, and is compiled in its own solution).

    This will normally be encountered when you select a GameObject in the hierarchy window before you press play. When you press play, GameObjects are destroyed and rebuilt in a scene. Not in the same way that game code destroys or re-instantiates them, mind you. But they have to be re-loaded from a scene when you press play.

    For example, if the inspector window has selected an object before you press play, the editor window saves this object as "Selection.activeGameObject". Since the editor window logic will continue to run even though the game is compiling and running. This can theoretically (and in my case has) caused some editor window exceptions where suddenly an object becomes null for the editor window. Given the above example, the reference to "Selection.activeGameObject" will be broken when pressing play. Unity should gracefully handle this error, but it can and has continued to paint frames for the InspectorWindow, and erred when the activeGameObject is suddenly null. But this doesn't always happen. It can be based on Unity version, or a number of other factors.

    This isn't to say that this is the exact issue you are having, but it's an example of the type of issue that can occur due to an editor window painting a new frame when you press play.

    Still, these types of errors should be a completely harmless error, and will not exist outside of the editor. Consider it something similar to "Coroutine continue failure" errors. Now, if this does somehow affect you, let me know. Thanks.
     
    Fceek likes this.
  6. AloneFlyer

    AloneFlyer

    Joined:
    Sep 29, 2019
    Posts:
    1
    try to restart Unity again
     
    planternfish likes this.