Gamepad Controls (Xbox One Controller)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Gamepad Controls (Xbox One Controller)

Post by KingCeryn »

Hey again, lol

So ive been following some instructions in a few older threads you posted about Gamepad controls, but theyre all from 2016-ish, and im not sure if the process is still the same. I'm basically just trying to use the A/B/X/ Buttons, and the D-Pad on the controller to control Dialogue Conversations, but i cant quite seem to get them to work.

The Input Manager seems to detect my gamepad whenever I press A/B/X/Y, but not the D-Pad or the main sticks(Joysticks 9/10). I'm using the old Input manager, and I have the Auto Focus options ticked, but not sure what I'm missing. I think the Continue button is being detected, but not the response options.

The blue circles in this photo seem to be detecting, but not the red circle inputs. These are the names as defined in the Input Manager, with the proper controller axis
Attachments
GamepadDialogue.PNG
GamepadDialogue.PNG (66.11 KiB) Viewed 4104 times
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gamepad Controls (Xbox One Controller)

Post by Tony Li »

Hi,

The Input Device Manager component uses both circled inputs to determine when you're using a gamepad. But, since you've ticked Always Auto Focus, it doesn't really matter. It's only important to know when you're using a gamepad if Always Auto Focus is unticked, since then the Dialogue System needs to focus menu buttons only when using a gamepad.

Actual navigation of menu buttons doesn't use the Input Device Manager. It uses Unity UI's Event System. Inspect the scene's Event System GameObject. If the scene doesn't have one, add one. It should have an input module, such as Standalone Input Module, with Horizontal and Vertical fields. Try setting these to "D-Pad Horizontal" and "D-Pad Vertical", assuming those are the inputs defined in Edit > Project Settings > Input.
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

[SOLVED] Gamepad Controls (Xbox One Controller)

Post by KingCeryn »

Ah, thanks! I'm still learning the new input system so i wasnt sure how to make that switch, it works great now!
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Re: Gamepad Controls (Xbox One Controller)

Post by KingCeryn »

One last question, just regarding the Quest Machine Log- if i wanted to use a button like X or A to track a quest when im cycling through the quests i have active, which component would i need to add to the button/toggle?

Right now when i press X or A, it just changes to the next quest similiar to up/down on the Dpad.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gamepad Controls (Xbox One Controller)

Post by Tony Li »

Hi,

Are you using Quest Machine's Quest Journal UI or the Dialogue System's Quest Log Window?

In either case, it uses regular Unity UI navigation as defined on your Event System GameObject. You should be able to navigate to the tracking toggle using the Event System's Horizontal and Vertical inputs, and then toggle the value by pressing the Submit input.
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Re: Gamepad Controls (Xbox One Controller)

Post by KingCeryn »

Ah I'm using the Quest Machine log, and yeah i was able to get the navigation working, but it only lets me select the quest itself or the Abandon button/Abandon confirm menu, not the track toggle
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gamepad Controls (Xbox One Controller)

Post by Tony Li »

Hi,

I see that Unity UI's automatic navigation is skipping over the tracking toggle when using a gamepad. I'll have to add an option to have it set up explicit navigation so you can navigate to the toggle.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gamepad Controls (Xbox One Controller)

Post by Tony Li »

Navigating to the toggle was a bit awkward since it's a child of the quest name selection button, so I added an option to show a Track toggle button in the quest details section. To enable it, import this patch:

QM_JournalUIPatch_2022-03-04.unitypackage

Then inspect the Quest Journal UI and tick Show Track Button In Details.
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Re: Gamepad Controls (Xbox One Controller)

Post by KingCeryn »

ah, thanks! Its all working now, just need to smooth out my event system input, sometimes B and A get swapped, and Left/Right becomes Up/Down, but i think thats on my end so ill work it out.

thanks again for all your help!
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gamepad Controls (Xbox One Controller)

Post by Tony Li »

Glad to help!
Post Reply