Dialogue For Split Screen Using a Gamepad

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

That sounds like a config issue in your input actions asset.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

I'm not sure why. Player 1 and 2 have the same Input working for them. I'm using the new unity input system.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Do other functions of Player 1's 'A' button, such as jumping, work while the joystick is neutral?

Are there any errors or warnings in the Console window?

Can you try backing up your project and updating to the latest version of the Input System package?
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

I got almost all the controls of Player 1 working so far, except his dialogue. I tried working things around, but he doesn't continue the conversation with the NPC with the A button. I don't know why yet. All other controls work while neutral.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hmm, check what input is assigned to the Continue Button's UI Button Key Trigger / Player Input Button Hotkey in Player 1's dialogue UI. Maybe it's not reading the correct input action.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Nope, everything looks the same as Player 2's controls for the UI, whom is working. I do get this error whenever I interact with the NPC:

NullReferenceException: Object reference not set to an instance of an object
PlayerInputButtonHotkey.Update () (at Assets/TPC DS Test/Scripts/PlayerInputButtonHotkey.cs:25)

But that seems to be coming from the script I downloaded from you. It doesn't seem to relate to anything I'm doing in my own scene. It even happens when Player 2 interacts, but then she can still continue the conversation. No other errors are present.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

PlayerInputButtonHotkey assumes the Button is in a player's hierarchy, and that a parent GameObject (e.g., the root player GameObject) has a PlayerInput component somewhere up in the hierarchy. If it doesn't find one, then it won't work.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Okay. I also just noticed a couple of Player 1's input isn't working. I'm not sure why though. They both use controls from a single Unity Input System, so I don't know why they don't do the same things. I'll have to check all the Details in the Inspector to see if there is anything I might have missed...
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Nope I was wrong. It is only his dialogue that isn't working. I have one bubble where the NPC (Sonya) speaks, and Player1 can't continue. I have to use Player2's button to continue. The response though, which is just the A button to say "Goodbye", works for Player1. I checked all the inputs for the Continue button and nothing is jumping out at me as wrong. It looks identical to Player 2. Except for the things that are supposed to be P1 and P2...

Darn, I was almost done with this so I could get to the Quest part. Thanks for helping me out so far and I will await your response.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

I set up a test scene:

TPC_DS_Test_Scene_Continue_Button_2021-05-28.unitypackage

Here's how it differs from the previous test scene:

1. Set the Dialogue Manager's Subtitle Settings > Continue Button mode to Always.

2. Modified the PlayerInputButtonHotkey script to let you assign an optional PlayerInput component. (If the script is in the player's hierarchy, no need to assign the PlayerInput component.)

3. Added continue buttons to the NPC P1 and NPC P2 subtitle bubbles. Configured PlayerInputButtonHotkey on both.
Post Reply