Im getting a null reference error that leads to the UpdateUI methods line we added in this script. i know its something small im missing but i cant find it for the life of me…
//from DialogueUI
void UpdateUI()
{
gameObject.SetActive(_playerConversant.IsActive());
if(!_playerConversant.IsActive())
{
return;
}
_conversantName.text = _playerConversant.GetCurrentConversantName();
AIResponse.SetActive(!_playerConversant.IsChoosing());
_choiceRoot.gameObject.SetActive(_playerConversant.IsChoosing());
if(_playerConversant.IsChoosing())
{
BuildChoiceList();
}
else
{
_AIText.text = _playerConversant.GetText();
_nextButton.gameObject.SetActive(_playerConversant.HasNext());
}
}
//from PlayerConversant
public string GetCurrentConversantName()
{
if(isChoosing)
{
return _playerName;
}
else
{
return _currentConversant.GetName();
}
}
Inspector on enemy with dialogue trigger
Inspector on player (Im 90% sure i don’t need dialogue in the players CurrentDialogue field anymore… but i tried with and without
this is the error in full
i dont think it matters but as my script is not identical to the projects… line 29 of the AI conversant( referenced in error log) is he StartDialogue line of HandleRaycast
public bool HandleRaycast(PlayerController callingController)
{
if(_AIQuest == null)
{
return false;
}
if (Input.GetMouseButtonDown(0))
{
PlayerConversant playerConversant = callingController.GetComponent();
playerConversant.StartDialogue(this, _AIQuest);
}
return true;
}