Show dialog entry on 2D object touch/click
-
- Posts: 40
- Joined: Mon Sep 05, 2022 5:40 am
Show dialog entry on 2D object touch/click
Hii..
I have made conversation dialog tree in which dialog entry suppose like this :
1) Hello1
2) Hello2
3) Let me knock at the door
4) Yes, How can i help you?
This conversation starts when scene loads. now when i click continue then 2) Hello2 will be displayed. then again click continue then 3) let me knock at the door will be displayed.
Now when i click on door then only 4) Yes, How can i help you? should be displayed. Not on continue button or automatically.
Thanks.
I have made conversation dialog tree in which dialog entry suppose like this :
1) Hello1
2) Hello2
3) Let me knock at the door
4) Yes, How can i help you?
This conversation starts when scene loads. now when i click continue then 2) Hello2 will be displayed. then again click continue then 3) let me knock at the door will be displayed.
Now when i click on door then only 4) Yes, How can i help you? should be displayed. Not on continue button or automatically.
Thanks.
Re: Show dialog entry on 2D object touch/click
Set (3)'s Sequence to:
Set (4)'s Sequence to:
Configure the door to send the sequence message "ClickedDoor". If the door has a collider, you could do it in a script with an OnMouseUp() method, such as:
SequencerMessageOnMouseUp.cs
More info:
Code: Select all
SetContinueMode(false);
WaitForMessage(ClickedDoor)
Code: Select all
SetContinueMode(true)
SequencerMessageOnMouseUp.cs
Code: Select all
using UnityEngine;
public class SequencerMessageOnMouseUp : MonoBehaviour
{
public string message = "ClickedDoor";
void OnMouseUp()
{
PixelCrushers.DialogueSystem.Sequencer.Message(message);
}
}
-
- Posts: 40
- Joined: Mon Sep 05, 2022 5:40 am
Re: Show dialog entry on 2D object touch/click
Hii Tony,
Eventhough i have added to sequence part of Line 3 node it's working on continue button click where as i want only on door click.
I make set up on door collider also which is working but how to prevent it from UI continue button?
Eventhough i have added
Code: Select all
SetContinueMode(false);
WaitForMessage(ClickedDoor)
I make set up on door collider also which is working but how to prevent it from UI continue button?
- Attachments
-
- Screenshot 2022-09-06 190043.png (37.24 KiB) Viewed 297 times
Re: Show dialog entry on 2D object touch/click
Hi,
That Sequence looks correct. Are you editing the correct dialogue database asset? Make sure you're not accidentally editing the auto-backup asset. Also check that the correct dialogue database is assigned to the Dialogue Manager's Initial Database property.
If that looks correct, are there any errors or warnings in the Console window?
That Sequence looks correct. Are you editing the correct dialogue database asset? Make sure you're not accidentally editing the auto-backup asset. Also check that the correct dialogue database is assigned to the Dialogue Manager's Initial Database property.
If that looks correct, are there any errors or warnings in the Console window?
-
- Posts: 40
- Joined: Mon Sep 05, 2022 5:40 am
Re: Show dialog entry on 2D object touch/click
Hii Tony,
There is no error , no warning in log. and i am making changes in right conversation. i checked 2 times.
Is there any other way i can do same?
There is no error , no warning in log. and i am making changes in right conversation. i checked 2 times.
Is there any other way i can do same?
-
- Posts: 40
- Joined: Mon Sep 05, 2022 5:40 am
Re: Show dialog entry on 2D object touch/click
My problem is next dialog entry(4) Yes, How can i help you?) should be displayed only on door object click not on continue button click.
In my case using above code, it's working on continue button click also.
how can i stop using continue button just for 4th number dialog entry?
I am using this code :
It should work for not allowing action on continue button. but i don't understand why it is allowing.
In my case using above code, it's working on continue button click also.
how can i stop using continue button just for 4th number dialog entry?
I am using this code :
Code: Select all
SetContinueMode(false)