Background picture in conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VillVarh
Posts: 23
Joined: Mon Nov 06, 2023 5:19 am

Background picture in conversation

Post by VillVarh »

Hello. I want to display a background image when start a conversation with an object. The conversation is just a one line that the actor says. I have sequence where I use "SetActive" and the picture does display when i start the conversation but i can't seem to stop displaying the image. I have tried to set new dialogue system trigger to the object that triggered the dialogue. I set that trigger to "OnConversationEnd" and action to set gameobject false. It doesn't work. :(
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Background picture in conversation

Post by Tony Li »

Hi,

Here are two ways to accomplish this:

1. In the dialogue entry node, use two SetActive() sequencer commands -- one to show the background image, one to hide it. For example, say the background image's GameObject is named "Background1". If you do not require the player to click the continue button to proceed, you could set the Sequence to:

Code: Select all

SetActive(Background1, true);
required SetActive(Background1, false)@{{end}}
If you do require the player to click the continue button to proceed, use this instead:

Code: Select all

SetActive(Background1, true);
required SetActive(Background1, false)@Message(Clicked)

2. Or add a Dialogue System Events component to the GameObject that's used as the conversation actor or conversation conversant. Please see Character GameObject Assignments to understand how GameObjects are associated with conversation actors and conversants. Configure the OnConversationStart() UnityEvent to show the image and OnConversationEnd() to hide it.
VillVarh
Posts: 23
Joined: Mon Nov 06, 2023 5:19 am

Re: Background picture in conversation

Post by VillVarh »

Thank you very much 1. worked for me. :D
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Background picture in conversation

Post by Tony Li »

Glad to help!
Post Reply