How to start conversation automatically on trigger enter?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
datchcole
Posts: 10
Joined: Tue Jun 15, 2021 2:05 am

How to start conversation automatically on trigger enter?

Post by datchcole »

Hello. I have a conversation set to start on entering a trigger, and it does display the prompt to accept input to start the conversation, but I want the conversation to start automatically upon trigger enter without any user input, and I don't want it to display the input prompt. How do I do this for just one specific conversation? Thank you.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to start conversation automatically on trigger enter?

Post by Tony Li »

Hi,

Set that Dialogue System Trigger's trigger dropdown to OnTriggerEnter.

A button will offer to add the 'Player' tag as a Conditions requirement. This will ensure that the conversation only starts when GameObjects tagged 'Player' enter the trigger.

OnTriggerEnter uses regular physics checks, so make sure your layers, colliders, etc., are set up to register collisions. If you're using 2D, enable the Dialogue System's 2D support.
datchcole
Posts: 10
Joined: Tue Jun 15, 2021 2:05 am

Re: How to start conversation automatically on trigger enter?

Post by datchcole »

Oops this was actually my fault on my end. I had previously had my player tagged as lowercase 'player' and the dialogue system trigger component autofilled the accepted tag as 'Player'. My bad, but thank you for your reply!
datchcole
Posts: 10
Joined: Tue Jun 15, 2021 2:05 am

Re: How to start conversation automatically on trigger enter?

Post by datchcole »

Oh! If you see this, is there a shortcut to disabling the portrait panel on specific conversations or actors? I can disable it in a script, but wanted to see if there was a built-in way first.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to start conversation automatically on trigger enter?

Post by Tony Li »

Hi,

If no portrait sprite is assigned to the actor, it will automatically disable the portrait image (but not name) when show that actor's subtitle.

Otherwise, you can set up a separate subtitle panel that doesn't have a portrait image (or portrait name, if you want). For example, duplicate 'NPC Subtitle Panel' and remove its Portrait Image and Portrait Name child GameObjects. Assign the subtitle panel to the Standard Dialogue UI component's Conversation UI Elements > Subtitle Panels list. It will have a number in the list.

Then either:
  • Add a Dialogue Actor component to the actor's GameObject and set Dialogue UI Settings > Subtitle Panel Number to that panel if you want the actor to always use that panel.
  • Or use the [panel=#] markup tag in text if you only want to use the panel for one line.
Post Reply