Page 1 of 3

New Input System Question

Posted: Fri Feb 12, 2021 12:10 pm
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

Re: New Input System Question

Posted: Fri Feb 12, 2021 1:08 pm
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?

Re: New Input System Question

Posted: Fri Feb 12, 2021 2:17 pm
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?

Re: New Input System Question

Posted: Fri Feb 12, 2021 2:51 pm
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.

Re: New Input System Question

Posted: Fri Feb 12, 2021 3:43 pm
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:

Re: New Input System Question

Posted: Fri Feb 12, 2021 3:53 pm
by Tony Li
Try assigning your Player_Inputs to the Input System UI Input Module's Actions Asset, and then select "Confirm_Gamepad".

Re: New Input System Question

Posted: Fri Feb 12, 2021 4:55 pm
by megadok
I did it. I press the buttons but it doesn't detect them.

https://ibb.co/RN3ZPcj <-----Event System

Re: New Input System Question

Posted: Fri Feb 12, 2021 5:06 pm
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.

Re: New Input System Question

Posted: Fri Feb 12, 2021 5:49 pm
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");
    }
}

Re: New Input System Question

Posted: Fri Feb 12, 2021 8:04 pm
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?