On Use not working

Announcements, support questions, and discussion for the Dialogue System.
TomsTales
Posts: 16
Joined: Tue Apr 27, 2021 6:38 am

On Use not working

Post by TomsTales »

Hi Guys,

I followed the YT-Tutorial on this but while it seems simple, I can't get it to work. I have played with the distances and 2D/3D, but it's not getting detected. Any idea where in my project the error might be? I am currently using the standard camera, nothing fancy here, but this also was not working when using distance from camera and not the game object...
Last edited by TomsTales on Mon Aug 09, 2021 6:44 am, edited 2 times in total.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: On Use not working

Post by Tony Li »

Hi,

On the Selector component, try setting Max Selection Distance to 9999 and Run Raycasts to In 2D.

Also tick the Welcome Window's USE_PHYSICS2D checkbox.

Make sure your Usable GameObject also has a 2D collider, since that's what the Selector will look for to detect usables.
TomsTales
Posts: 16
Joined: Tue Apr 27, 2021 6:38 am

Re: On Use not working

Post by TomsTales »

Thank you as always for your fast support, much appreciated!

This is now detecting the mouse and showing the "press space to..." message. However, if I press space or right mouse button, nothing happens. It should all be correct (well obviously it isn't, but...) maybe you can have a look again (there is dialogue in the conversation, it's not empty)
Last edited by TomsTales on Mon Aug 09, 2021 6:45 am, edited 1 time in total.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: On Use not working

Post by Tony Li »

Hi,

Are there any errors or warnings in the Console window?

Are you using Unity's standard, built-in input manager, or are you using a replacement such as the new Input System package?

Is the dialogue database containing the Drunken Man Conversation assigned to your Dialogue Manager GameObject?

Since 'Skip If No Valid Entries' is ticked, the trigger will check if any nodes linked from <START> are valid (i.e., not blocked by a Conditions field that evaluates false). If no nodes are currently valid, it won't try to start the conversation.

After trying to interact with the NPC, please inspect the Dialogue System Trigger's Conditions section. It should show a green (Last Check: True) or red (Last Check: False). If it's red, review the subsections in Conditions to see why it thinks the Conditions are false, which will prevent the trigger from running the actions.
TomsTales
Posts: 16
Joined: Tue Apr 27, 2021 6:38 am

Re: On Use not working

Post by TomsTales »

Hi Tony,

it looks like it's not really registered tbh. The Console does not show anything when clicking. I am using the old input manager, no replacement. The database should be correct, but I have attached all screens. If I put the trigger to "on start" it works just fine by the way. The mouse over is registered, it's just not starting the draft conversation.
Last edited by TomsTales on Mon Aug 09, 2021 6:45 am, edited 1 time in total.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: On Use not working

Post by Tony Li »

Hi,

Inspect the Dialogue Manager GameObject, and temporarily set the Other Settings > Debug Level dropdown to Info.

Then play the scene, move the mouse over the Drinking_Man, and press the space bar. This should log info to the Console window. Look for lines such as:

Dialogue System: Dialogue System Trigger is firing OnUse.
Dialogue System: Starting conversation 'Drunken Man Conversation', actor=Player (UnityEngine.Transform), conversant=Drinking_Man (UnityEngine.Transform).

If you see those lines, then the Selector and Dialogue System Trigger are properly starting the conversation -- in which case, we need to look at the dialogue UI setup.

If you don't see those lines, then the Selector probably isn't detecting your input or something like that.
TomsTales
Posts: 16
Joined: Tue Apr 27, 2021 6:38 am

Re: On Use not working

Post by TomsTales »

Hey, doesn't show anything (besides the stuff when starting the scene):



Are there any experiences you had with why the input is not detected?
Last edited by TomsTales on Mon Aug 09, 2021 6:45 am, edited 1 time in total.
TomsTales
Posts: 16
Joined: Tue Apr 27, 2021 6:38 am

Re: On Use not working

Post by TomsTales »

ok it must be something weird within the project, as Ive set up a new test project and it worked just fine, so I am not just too stupid to set it up :lol:

edit: after I re-opened the project and deleted the components and added them again, it's working. no idea why, but it is :o :lol:
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: On Use not working

Post by Tony Li »

If the Selector is showing "Drunken_Man / (spacebar to interact)" when you mouse over him, then the Selector is detecting it correctly. From there, it's just a matter of figuring out if the Selector isn't detecting when you press the space bar, or if it's detecting but not sending the OnUse message to Drunken_Man. Make sure nothing is inadvertently disabling the Dialogue System Trigger during play. If that doesn't help, and if you can't find the different between your new test project and your original project, feel free to send a reproduction project to tony (at) pixelcrushers.com.
TomsTales
Posts: 16
Joined: Tue Apr 27, 2021 6:38 am

Re: On Use not working

Post by TomsTales »

After a restart and attaching the components again, it works well. Didn't change a thing as far as I can see so I guess it was Unity :lol:

Thanks again for the great support, I'd rate 5 stars again if I could :)
Post Reply