Start Conversation mouse click

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Rokatansky
Posts: 3
Joined: Thu Jul 15, 2021 3:39 am

Start Conversation mouse click

Post by Rokatansky »

I'm using your manual in my 2d game. On start dialogues works, but when I'm changing to "On use"(mouse position etc) to start conversation on mouse click it doesn't work. I tried Cube, Button, Square. I tried with empty scene, but I don't see "Press space to Interact" and clicking right mouse button does nothing.
I'm using version 2020.3
User avatar
Tony Li
Posts: 22159
Joined: Thu Jul 18, 2013 1:27 pm

Re: Start Conversation mouse click

Post by Tony Li »

Hi,

Make sure you've enabled 2D Physics support. (In the Dialogue System's Welcome Window, tick the USE_PHYSICS2D checkbox.)

Try setting the Selector's Max Selection Distance to 9999.

Are there any errors or warnings in the Console window?
Rokatansky
Posts: 3
Joined: Thu Jul 15, 2021 3:39 am

Re: Start Conversation mouse click

Post by Rokatansky »

Sorry, I should''ve mentioned I read FAQ and applied recommendations.
No errors in log.
Tried few times with no luck, so I' tried to rewrite my code to work with "on enable", but then I can start dialogue only once per scene visit, which is bad and unacceptable. I thought it would be easier to make "on use". Looks like I'm missing something, but can't figure it out. I tried in new project with empty scene and can't get it to work anyway
User avatar
Tony Li
Posts: 22159
Joined: Thu Jul 18, 2013 1:27 pm

Re: Start Conversation mouse click

Post by Tony Li »

Hi,

Are you using the new Input System package? It has a bug with mouse detection. I can post a workaround here if that's the case.

If you're using Unity's built-in input, here's an example scene:

DS_TestSelector2D_2021-07-15.unitypackage

Please let me know if that works in your project. If not, check that Edit > Project Settings > Player > Other Settings > Scripting Define Symbols includes USE_PHYSICS2D.
Rokatansky
Posts: 3
Joined: Thu Jul 15, 2021 3:39 am

Re: Start Conversation mouse click

Post by Rokatansky »

Thanks, it works.
I copied this scene in my project and found out I should place element with Dialogue system trigger in Camera window, not in canvas. This way it works
User avatar
Tony Li
Posts: 22159
Joined: Thu Jul 18, 2013 1:27 pm

Re: Start Conversation mouse click

Post by Tony Li »

Glad to help!
Post Reply