Page 1 of 1

Problems integrating Unity's new input system

Posted: Tue Oct 01, 2024 5:44 pm
by Ignaxavier
Hi everyone, I am a newbie in Dialogue System, I am using it for the first time in a project in which I have integrated the new input system of Unity.
In my project, I created on one side a singleton that is in charge of storing delegates for each action, and each time they are triggered, they execute all the methods that subscribed to each method.
Screenshot_56.png
Screenshot_56.png (57.15 KiB) Viewed 90 times
Screenshot_57.png
Screenshot_57.png (40.46 KiB) Viewed 90 times
Now, in my Input Action Asset, I have two Action Maps: one for the UI and the other for the Gameplay.
Why do I do this? To have a better control of the inputs, so when I interact with a note, for example, I change the Action Map so that only the UI actions are triggered.
Screenshot_58.png
Screenshot_58.png (13.51 KiB) Viewed 90 times
Screenshot_59.png
Screenshot_59.png (9.62 KiB) Viewed 90 times
Well, my problem starts with the Dialogue System Input Device interfering with my InputManager, I watched the video tutorial but it didn't help me much, I would need to find an alternative to bypass the Input Device or something like that. To control the inputs as I was doing and not generate a lot of spaghetti code.
Any advice or tips?

Re: Problems integrating Unity's new input system

Posted: Tue Oct 01, 2024 8:11 pm
by Tony Li
Hi,

The Dialogue System's InputDeviceManager is really only used by the Selector, ProximitySelector, and UIButtonKeyTrigger components. If you aren't using any of these components and don't want to write a small script to interface your input actions with the InputDeviceManager, you can clear everything on the Dialogue Manager's InputDeviceManager such as the Keys/Buttons/Axes To Check and the Submit and Back fields.

Dialogue UIs and quest log windows use Unity UI's EventSystem. They don't read from the InputDeviceManager. As long as your regular Unity UI EventSystem works, the rest of the Dialogue System will work fine with it.

Re: Problems integrating Unity's new input system

Posted: Tue Oct 01, 2024 9:19 pm
by Ignaxavier
That's the part I wasn't understanding, thank you.
I was able to do what I wanted to do, basically I had to call the Fire() Method of the Dialogue System Trigger, now it works.
Thank you very much. :D

Re: Problems integrating Unity's new input system

Posted: Tue Oct 01, 2024 9:25 pm
by Tony Li
Glad to help!