Use Input System Actions For Selector?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
segfault
Posts: 1
Joined: Sun Nov 13, 2022 3:30 pm

Use Input System Actions For Selector?

Post by segfault »

Hi,

I'm new to Dialogue System, so maybe this is against best practices, but I'm using the new Unity Input System for movement/interaction, and I'd like to use the same action map for both conversations and gameplay. The Selector element on my Player object has a "Use Key" property, which works just fine, but I'd like to keep all of my actions in one place.

Is there a way to interact with a "Usable" without a Selector component?

Thanks in advance,
Chris
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Use Input System Actions For Selector?

Post by Tony Li »

Hi Chris,

Yes. Selectors and Usables are entirely optional. You can directly call a Dialogue System Trigger's OnUse() method, or you can use DialogueManager.StartConversation() in a C# script.

Or, if you want to use a Selector or Proximity Selector with the Input System package, you can define an action (e.g., "Interact" or something) in your InputActions asset and set the Selector's Use Button field to the name of that action. Make sure to enable the Dialogue System's Input System integration. (video tutorial)
Post Reply