MissingReferenceException when calling agent.name

Forums 💬 NodeCanvas ⚙️ Support MissingReferenceException when calling agent.name

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15165
    nicolasoto
    Participant

      I regularly use Unity with Domain Reload disabled under Project Settings. Normally this speeds up entering play mode with no obvious downside.

      However, I added the following code within a custom ConditionTask:

      Debug.Log($”Agent: {agent.name}”);
      and I now get the following error (after entering play mode and hitting that line of code, stopping play mode, and entering play mode a second time and hitting the same line of code again):

      MissingReferenceException: The object of type ‘FSMOwner’ has been destroyed but you are still trying to access it.
      Your script should either check if it is null or you should not destroy the object.

      #15166
      Gavalakis
      Keymaster

        Hello. Hmm. There shouldn’t be any problems with Domain Reload disabled (I have it disabled all the time when developling NodeCanvas to support this) and there are lot of tasks that already use the ‘agent’ property of course. Under which method do you use that code? Is that in OnCheck?

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