Hi
I want to have an object appear in my scene, after a dialogue is completed.
I already found out that SetActive() needs to be added in the 'Sequence' in the Inspector (http://www.pixelcrushers.com/dialogue_s ... dSetActive)
However, I'm still a newbie in programming and not executing it right, because it's not working. The object is currently inactive in the scene, however its parent is an active empty game Object (am I doing this right?). And I entered SetActive(gameObject,[true]) in the 'Sequence'.
I'm a bit confused about 'gameObject': do I need to leave it written like this, or do I need to enter the tag of the game object or the name? Or does it automatically know which gameObject is inactive in the scene and goes to look for that?
SetActive() question
Re: SetActive() question
Hi,
You're almost there. Let's say the GameObject is named "Force Field" (without quotes). Put this command in the Sequence field:
A subtitle will display for as long as its Sequence runs. The command above runs immediately. It doesn't take any time. This means the subtitle will only flash onscreen briefly. You may want to set the Sequence field to:
This will pull in the Dialogue Manager's Default Sequence, which is typically set to delay for a duration based on text length.
Note also that you don't necessarily have to type any of this. If you drag a GameObject from the Hierarchy onto the Sequence field, it will add the SetActive command for you. Similarly, if you click "+", you can select the menu option to add {{default}}.
You're almost there. Let's say the GameObject is named "Force Field" (without quotes). Put this command in the Sequence field:
Code: Select all
SetActive(Force Field, true)
Code: Select all
SetActive(Force Field, true);
{{default}}
Note also that you don't necessarily have to type any of this. If you drag a GameObject from the Hierarchy onto the Sequence field, it will add the SetActive command for you. Similarly, if you click "+", you can select the menu option to add {{default}}.
Re: SetActive() question
Awesome, thanks so much!