Hi all,
Inside the Dialogue -> Conversations... Is there any possibility to, for example, active a game object from the scene when reached a certain part of the dialogue?
Thanks,
Javier.
[Solved] Dialogue -> Conversations // Doubt!
[Solved] Dialogue -> Conversations // Doubt!
Last edited by Japtor on Wed Jul 11, 2018 3:29 am, edited 1 time in total.
Re: Dialogue -> Conversations // Doubt!
Hi Javier,
Yes, use the SetActive() sequencer command in the Sequence field.
For example:
The SetActive(ForceField) command finds a GameObject named "ForceField" and activates it. This GameObject should have a parent GameObject that is active.
Yes, use the SetActive() sequencer command in the Sequence field.
For example:
- Dialogue Text: "Activating the force field."
- Sequence: {{default}}; SetActive(ForceField)
The SetActive(ForceField) command finds a GameObject named "ForceField" and activates it. This GameObject should have a parent GameObject that is active.
Re: Dialogue -> Conversations // Doubt!
Hi,
Thanks for the answer
And what about if, for example, the object that I would like to active has attached a script which has a public variable of type int. It is possible to set it via Dialogue -> Conversation?
Thanks,
Javier.
Thanks for the answer
And what about if, for example, the object that I would like to active has attached a script which has a public variable of type int. It is possible to set it via Dialogue -> Conversation?
Thanks,
Javier.
Re: Dialogue -> Conversations // Doubt!
Yes. Here are three different ways. You can choose the one you prefer.
1. Add a method to set the int. The method must accept a string parameter. For example:
Then use the SendMessage() sequencer command:
2. Or write a custom sequencer command.
3. Or register a Lua function and use it in the Script field (not the Sequence field like the above 2 options).
1. Add a method to set the int. The method must accept a string parameter. For example:
Code: Select all
public int myVariable;
public void SetInt(string value)
{
myVariable = System.Convert.ToInt32(value);
}
Code: Select all
{{default}};
SetActive(ForceField);
SendMessage(SetInt, 99, ForceField)
2. Or write a custom sequencer command.
3. Or register a Lua function and use it in the Script field (not the Sequence field like the above 2 options).
Re: Dialogue -> Conversations // Doubt!
Hi,
Ok, I will try one of them. Thanks for answering!
Regards,
Javier.
Ok, I will try one of them. Thanks for answering!
Regards,
Javier.