NodeCanvas nullref in Blackboard Asset => Add Variable

Forums 💬 NodeCanvas ⚙️ Support NodeCanvas nullref in Blackboard Asset => Add Variable

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15810
    deprecated person
    Participant

      Using Unity 2021.1.26f1 I created a Blackboard asset, selected it and clicked on “Add Variable”. The popup window opened and stated “Loading…” indefinetely with a nullref error logged to console.

      I fixed this quickly by going into EditorUtils.ContextMenus.cs:

              public static MenuItemInfo[] GetMenuItems(GenericMenu menu) {

      var itemField = typeof(GenericMenu).GetField(“m_MenuItems”, BindingFlags.Instance | BindingFlags.NonPublic);

      var items = itemField.GetValue(menu) as IList;

      Apparently GenericMenu “menuItem” is no longer a field and thus “m_MenuItems” needs to be used. In addition, it’s not an ArrayList but a List<GenericMenu.MenuItem>. I cast it as IList since MenuItem seems to be a private type. As far as I can tell this restores the blackboard functionality.

      #15812
      Gavalakis
      Keymaster

        Hello and thank you for the post.

        This has been fixed in the latest version that is now live on the asset store. (The version number is the same because it was a very minor change).

        Can you please update and confirm?

        Thanks!

        #15811
        deprecated person
        Participant

          Yes, adding variables to a GlobalBlackboard asset is working now. 😉
          Interestingly Asset Store still listed “Sep 20th” as latest release, but I re-installed anyway and importer checked several files as changed.

           

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.