New Input System Question

Announcements, support questions, and discussion for the Dialogue System.
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

New Input System Question

Post by megadok »

Hello!
It is my first time with the new input system and I have some doubts.
To the dialogue manager I have added a script for the inputs, as specified in the manual.
My character, using a raytrace, activates the NPC's trigger collider, which activates the dialogue. With the old input system it worked without problem.
What am I doing wrong?

Thank you!

https://ibb.co/9n2cfBP <---- Input Device Manager
https://ibb.co/qrhxCDj <---- Inputs
https://ibb.co/mJQCh8b <----Script
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: New Input System Question

Post by Tony Li »

Hi,

If you're not on the latest version of the Dialogue System, please back up your project and update.

Which input is not working?

What script is running the raycast?
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Re: New Input System Question

Post by megadok »

The first problem was in the raycast, I have already solved it. The dialog is activated. :D

The next problem is that it does not continue the dialog, which means that it is not assimilating the "Confirmar_Gamepad" button on my joystick (I use this button to activate the raycast and it works well).

What could be the problem?
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: New Input System Question

Post by Tony Li »

Are there any errors or warnings in the Console window?

Are you using subtitle panels' continue buttons?

If so, keep an inspector open on the EventSystem. At runtime, it will show what button is currently selected (focused).

If the button is selected but your input doesn't work, make sure the Event System's Submit button is set to "Confirmar_Gamepad".

If the button is not selected, inspect the Dialogue Manager and tick Always Auto Focus.
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Re: New Input System Question

Post by megadok »

https://ibb.co/ZS4jstv <----- EventSystem

I don't see how I can change the "submit" button to "Confirm_Gamepad". I don't understand much of this. :oops:
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: New Input System Question

Post by Tony Li »

Try assigning your Player_Inputs to the Input System UI Input Module's Actions Asset, and then select "Confirm_Gamepad".
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Re: New Input System Question

Post by megadok »

I did it. I press the buttons but it doesn't detect them.

https://ibb.co/RN3ZPcj <-----Event System
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: New Input System Question

Post by Tony Li »

Make sure your EventSystem works with Unity UI without the Dialogue System first. In other words, let's temporarily simplify the variables by eliminating the Dialogue System.

Once you get that to work, then make sure the EventSystem has the continue button selected when the subtitle panel appears.
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Re: New Input System Question

Post by megadok »

I have created a test script where I activate the new input system and configure the button "Confirm_Gamepad", but eventsystem does not recognize any button. :roll: The dialogue system is disabled.

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.EventSystems;

public class prueba_input : MonoBehaviour
{
    Player_inputs inputs;


    private void OnEnable()
    {
        inputs = new Player_inputs();
        inputs.Enable();

    }


    // Start is called before the first frame update
    void Start()
    {
        inputs.Menu_basico.Confirmar_Gamepad.performed += ctx => boton();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void boton()
    {
        Debug.Log("boton usado");
    }
}
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: New Input System Question

Post by Tony Li »

Hi,

Maybe this link will help: https://docs.unity3d.com/Packages/com.u ... pport.html

I think once you get the Input System and Unity UI working without the Dialogue System, then it will work with the Dialogue System, too.

Are there any warnings or errors in the Console window?
Post Reply