Inputs not registering?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
DaSquid
Posts: 6
Joined: Wed Apr 17, 2024 2:46 pm

Inputs not registering?

Post by DaSquid »

Hi!
I recently purchased the dialogue system and I'm still setting up stuff. I can get conversations to work with a trigger collider and a dialogue system trigger set to "On Trigger Enter" on the NPC, along with a trigger collider on the Player.
I can't figure out how to make it work with OnUse though. I put a "Usable" component on the NPC, set its range to a generous amount and put a Proximity Selector component to the Player. I tried using different keys in the "Use Keys" variable but it doesn't work. The proximity is detected because when I get close to the NPC I get the heads up "Press Space bar to talk" but I can't start the conversation.
What am I doing wrong?
User avatar
Tony Li
Posts: 20677
Joined: Thu Jul 18, 2013 1:27 pm

Re: Inputs not registering?

Post by Tony Li »

Hi,

Are there any errors or warnings in the Console window?

If your Dialogue System Trigger's Trigger dropdown set to OnUse?

What input system are you using? Unity's default input manager, Rewired, Input System package, etc?
DaSquid
Posts: 6
Joined: Wed Apr 17, 2024 2:46 pm

Re: Inputs not registering?

Post by DaSquid »

Hi!
I get no error nor logs in the console window, my dialogue system trigger is indeed set to OnUse and I'm using the "new" input system. Hope this helps!
User avatar
Tony Li
Posts: 20677
Joined: Thu Jul 18, 2013 1:27 pm

Re: Inputs not registering?

Post by Tony Li »

Hi,

Since you're using the new Input System package, what have you assigned to the Use Key and Use Button fields?

Regular keyboard keys should generally work since the Dialogue System does a pretty good job of translating KeyCodes enums to Input System key definitions. There may be some exceptions, though.

For Use Button, you need to register your "use" input action with the Dialogue System as described in the Dialogue System's Input System video tutorial or page 5 of Input_Device_Manager_Manual.pdf.
DaSquid
Posts: 6
Joined: Wed Apr 17, 2024 2:46 pm

Re: Inputs not registering?

Post by DaSquid »

Ok so I didn't actually make the script to register the actions. Using the provided example code, I get the errors 'Cannot resolve symbol Controls' and 'Cannot resolve symbol MyControls'.

I'm guessing one of these is the name of the Input Action Asset, what is the other one?
DaSquid
Posts: 6
Joined: Wed Apr 17, 2024 2:46 pm

Re: Inputs not registering?

Post by DaSquid »

Little update, I created a script to register the actions just like in the video tutorial and the docs, but I still can't get to start a dialogue using OnUse. What could I be missing?
User avatar
Tony Li
Posts: 20677
Joined: Thu Jul 18, 2013 1:27 pm

Re: Inputs not registering?

Post by Tony Li »

Hi,

Would you please post a screenshot of your ProximitySelector component's Use Key and Use Button fields?

Double-checking: Are there any errors or warnings in the Console window? Check the toggles in the upper right to make sure the Console window isn't hiding errors and warnings.
DaSquid
Posts: 6
Joined: Wed Apr 17, 2024 2:46 pm

Re: Inputs not registering?

Post by DaSquid »

Hi!

No errors are hiding. I even tried putting this script somewhere

Code: Select all

if (InputDeviceManager.IsKeyDown(KeyCode.Space))
        {
            print("If you see this, I logged correctly");
        }
And it logs properly, so I'm guessing the problem is due to me not setting up things correctly in the selector.
I'm not too sure how to upload images, I'll try my best, here's the proximity selector:
Image
and the input action asset
Image
finally, the npc
Image

As I said, the game correctly detects when I'm close to the npc and prompts me to press the spacebar to start the dialogue, so the proximity selector seems to work properly, it's only starting the dialogue that gives me issues.

Thank you!
DaSquid
Posts: 6
Joined: Wed Apr 17, 2024 2:46 pm

Re: Inputs not registering?

Post by DaSquid »

I'm facepalming so hard right now that you can't even begin to understand.
For some obscure reason, my Player was not tagged as Player anymore (the "Untagged" label was in bold, so it changed for some unknown reason) and that's why it stopped working.
As always, the solution is always a dumb thing :D
Thank you for taking your time to help me debug this anyways, I really appreciate it
User avatar
Tony Li
Posts: 20677
Joined: Thu Jul 18, 2013 1:27 pm

Re: Inputs not registering?

Post by Tony Li »

Happy to help! Glad you got it working.
Post Reply