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

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Hulda_Gnodima
Posts: 19
Joined: Fri Jan 17, 2020 9:04 am

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

Post 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
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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
    }
}
User avatar
Hulda_Gnodima
Posts: 19
Joined: Fri Jan 17, 2020 9:04 am

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

Post 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
Post Reply