Page 1 of 1
Background picture in conversation
Posted: Mon Nov 20, 2023 4:00 am
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.
Re: Background picture in conversation
Posted: Mon Nov 20, 2023 8:52 am
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.
Re: Background picture in conversation
Posted: Tue Nov 21, 2023 3:57 am
by VillVarh
Thank you very much 1. worked for me.
Re: Background picture in conversation
Posted: Tue Nov 21, 2023 8:08 am
by Tony Li
Glad to help!