Page 1 of 1
2D images
Posted: Fri May 17, 2019 5:03 pm
by WTFosaurus
Hi new to unity and have very little experience coding. I'm trying to make a game and was recommended the dialog system. I started playing around with it and adding the variables and dialogue I needed was pretty easy.
What would be the simplest method of adding a 2D image jpeg/png or gif during a conversation that stays there until replaced later in the conversation?
I need it to display over any other elements except the UI and Dialogue.
Thanks for any help you can provide me!
Re: 2D images
Posted: Fri May 17, 2019 5:40 pm
by Tony Li
Hi,
Welcome to Unity and the Dialogue System!
The easiest way is to add the image to your scene as a child of an active GameObject, and deactivate it. In the screenshot below, the active GameObject is named Images, and it has some inactive image GameObjects named Duck, Pig, and Cow.
To activate the Duck in a dialogue entry node, set the
Sequence field to:
You can type this manually, or you can do it all with a mouse using these steps:
1. On the right-hand side of the Sequence field, click "+" > Include Dialogue Manager's Default Sequence.
2. Drag the Duck from the Hierarchy into the Sequence field.
- setActive.png (65.17 KiB) Viewed 254 times
If you want to later hide the Duck and show the Cow, use these commands in the Sequence field:
Code: Select all
{{default}};
SetActive(Duck,false);
SetActive(Cow,true)
Re: 2D images
Posted: Sat May 18, 2019 3:37 pm
by WTFosaurus
Awesome! Thanks for the quick reply. Your instructions were super easy to follow and I added the images I wanted to trigger during my test conversation very easily. Ran into a problem because I didn't know how to set an object to inactive to start. Initially got around it by listing a bunch of SetActive(fixed.Open_Image2,false); for each image in the conversation on the first node of the conversation.
Finally figured out that all I had to do was to hit that little check box in the inspector for each image to set starting state to inactive.
Thanks for the help!
Re: 2D images
Posted: Sat May 18, 2019 3:43 pm
by Tony Li
Glad to help!