Show AI response along with Player choosing

I think showing what the AI has just said along with reply choices for player within the same conversation makes it look better. The player have AI saying for context before choosing what to reply.

So what I did is changing UpdateUI() method in DialogueUI.cs just a bit, the part with comment below. Hope someone will find this interesting.

void UpdateUI()
        {
            gameObject.SetActive(playerConversant.IsActive());
            if (!playerConversant.IsActive()) 
            {
                return;
            }
            //AIResponse.SetActive(!playerConversant.IsChoosing());
            AIResponse.SetActive(true); // AI response always show even when player is choosing
            choiceRoot.gameObject.SetActive(playerConversant.IsChoosing());
            if (playerConversant.IsChoosing())
            {
                BuildChoiceList();
                nextButton.gameObject.SetActive(!playerConversant.HasNext()); // disable Next Button when player is choosing
            }
            else 
            {
                AIText.text = playerConversant.GetText(); 
                nextButton.gameObject.SetActive(playerConversant.HasNext());
            }         
        }
4 Likes

I wanted similar functionality and came to the same conclusion, one note though I don’t believe that you need the line AIResponse.SetActive(true); because that line is the only reference in the project (at the point i’m writing this comment), it is already active and since there is no longer any line to disable it there’s no need to enable it.

1 Like

Privacy & Terms