Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question No Popup for selection by "On Click", only an error

Discussion in 'Editor & General Support' started by Skyflamme, Sep 28, 2021.

  1. Skyflamme

    Skyflamme

    Joined:
    Aug 12, 2020
    Posts:
    33
    Hello,

    I wanted to program a game and I wanted to add something to a button, by the section "On Click{}", and I clicked to "No Function" so I can select a function. But now in the console accrued an error:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditorInternal.UnityEventDrawer.BuildPopupList (UnityEngine.Object target, UnityEngine.Events.UnityEventBase dummyEvent, UnityEditor.SerializedProperty listener) (at <1c8c981f35e342fb96463e6793772537>:0)
    3. UnityEditorInternal.UnityEventDrawer.DrawEvent (UnityEngine.Rect rect, System.Int32 index, System.Boolean isActive, System.Boolean isFocused) (at <1c8c981f35e342fb96463e6793772537>:0)
    4. UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <1c8c981f35e342fb96463e6793772537>:0)
    5. UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at <1c8c981f35e342fb96463e6793772537>:0)
    6. UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect) (at <1c8c981f35e342fb96463e6793772537>:0)
    I already restarted Unity and I cleared the Cache.

    Can somebody help me?
     
  2. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    328
    a missing script on the target object might cause it
     
  3. waterVGA

    waterVGA

    Joined:
    Nov 7, 2021
    Posts:
    1
    I had the same error just see in unity if the script has a error below the file

    This error is probably there because the class is not the same name as the file name
    I'm not sure if that's the error but that's the way if fixed it
     
    Last edited: May 18, 2022
  4. Skyflamme

    Skyflamme

    Joined:
    Aug 12, 2020
    Posts:
    33
    Thank you for helping, unfortunatley, that was not my error, I got it fixed by a quick restart of Unity. Have a good day!
     
  5. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    Thank you - this solved the problem for me