Selector with Input System Package

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
rjb32
Posts: 5
Joined: Sat Jul 04, 2020 11:46 am

Selector with Input System Package

Post by rjb32 »

Hello,

I switched my project over to use the Input System Package. I checked the box in the Dialogue System Welcome Window to switch to the new input system, and most everything seems to be working without issue with the exception of the Selector component I have on my Player game object.

When I set the Use Key to a mouse button on the Selector, it does not work. As a workaround, in DefaultGetKeyDown on InputDeviceManager.cs I removed the check to ignore the mouse and added a few lines to return mouse input, which works, but I have to imagine this isn't the intended way to handle this :) I'm not very familiar with the details of the new input system either, so it's possible I'm missing something there too.

Is there a "proper" way to use the mouse as the Use Key? Any suggestions would be appreciated. Thank you!
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Selector with Input System Package

Post by Tony Li »

Hi,

The new Input System doesn't use key codes. The Dialogue System's Input Device Manager does its best to translate key codes into keyboard input, but it doesn't handle mouse or joystick key codes. Instead, do this:

1. Define an input action (e.g., "Use") in your Input System's InputActions asset.

2. Set the Selector's Use Button to the name of that input action (e.g., "Use").

3. Register the input action with the Dialogue System's Input Device Manager. Example:

Code: Select all

InputDeviceManager.RegisterInputAction("Use", controls.Gameplay.Use);
(See the video tutorial or page 5 of Input_Device_Manager_Manual.pdf for details.)
Post Reply