Forum rules - please read before posting.

Error in UpdateLabel

edited May 2023 in Technical Q&A

Hi

One of my NPC characters reports this error at runtime.

NullReferenceException: Object reference not set to an instance of an object
AC.Char.UpdateLabel (System.Int32 languageNumber) (at Assets/AdventureCreator/Scripts/Character/Char.cs:4200)
AC.Char.GetName (System.Int32 languageNumber) (at Assets/AdventureCreator/Scripts/Character/Char.cs:4180)
AC.Char._Awake () (at Assets/AdventureCreator/Scripts/Character/Char.cs:470)
AC.NPC.Awake () (at Assets/AdventureCreator/Scripts/Character/NPC.cs:60)

https://drive.google.com/file/d/1-2S7mznY3ffsLWRgdEGEiFOgJy543cYU/view?usp=sharing, https://drive.google.com/file/d/1-2youtlHK7p66woTxkfR512lFVF65QxZ/view?usp=sharing

The Speech Label parameter is set to "Street Cop" and otherwise the NPC is the same as all the others. This error causes the NPC component to be disabled and the NPC stops following key actions.

Any ideas what's happening?

Ollu

Comments

  • edited May 2023

    Thanks for the bug report. You can fix it by opening AC's Char.cs script, and replace line 470:

    ACDebug.LogWarning ("Character " + GetName (0) + " has a NavMesh Agent, but no NavMesh Agent Integration component - unless you are using a custom motion controller, add this to make use of the NavMesh Agent.", this);
    

    with:

    ACDebug.LogWarning ("Character " + name + " has a NavMesh Agent, but no NavMesh Agent Integration component - unless you are using a custom motion controller, add this to make use of the NavMesh Agent.", this);
    

    The issue itself is a byproduct of your character having a NavMesh Agent component, but no NavMesh Agent Integration component to link it with AC.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.