Page 1 of 1

Having different "Show" animations for NPC verses PC dialog?

Posted: Tue Apr 27, 2021 4:21 pm
by Hulda_Gnodima
Hi!

I'm using a linerenderer to point from the speaking character to the dialog-box (see image below)

Image
Image

The crux is that the lineRenderer for the PC and NPCs are different. So preferebly when NPC dialog is show, I want to toggle on the purple line. When PC dialog is shown I'd like to toggle on the Yellow line. I tried doing this in the animation, but Show seems to be for the whole dialog system. If I try to toggle on/off both, the animator will eventually say they are missing in their animation like so:

Image

I might just be really tired and my brain isn't seeing the obivious solution. Or possibly I haven't read enough of your documentation!

How would you go about solving this? Or maybe its difficult to do in the Dialog System? I thought possibly I could have ONE lineRenderer that toggles on (and in check who's speaking and update its postions and colors accordingly) but I'm unsure how to do that. I'm also having difficulties running custom scripts on gameobjects inside the chosen Dialog Canvas .... Maybe I'm just tired! Hahhaah

Thanks in advance Tony you rock as ALWAYS :)
Hulda

Re: Having different "Show" animations for NPC verses PC dialog?

Posted: Tue Apr 27, 2021 5:14 pm
by Tony Li
Hi Hulda,

Are they separate subtitle panels? For example, maybe like the BubbleSubtitleExample on the Dialogue System Extras page?

If so, then each subtitle panel should be able to have its own LineRenderer.

If not, then you could add a script to the dialogue UI that has an OnConversationLine method. Maybe something like:

Code: Select all

void OnConversationLine(Subtitle subtitle)
{
    if (subtitle.speakerInfo.isNPC)
    {
        // use purple line
    }
    else
    {
        // use yellow line
    }
}

Re: Having different "Show" animations for NPC verses PC dialog?

Posted: Wed Apr 28, 2021 5:25 am
by Hulda_Gnodima
Thank you so much!
I will try to use the Bubble-prefab first to see if I can make it work, otherwise I'll use your code-example. :))
//Hulda