Mouse and Joystick Input?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Mouse and Joystick Input?

Post by Hereder »

Hi!
My mouse input is not working, nor is my keyboard.
I can only interact with the NPC when I hit the (X) button on my PS4 Controller.
It is as if the DialogueSystem is overruling everything else.
I can't press any UI buttons either when I open my PauseMenu.
I have this script that is comunicating with the New Input system in Unity:

Code: Select all

using UnityEngine;
using UnityEngine.InputSystem;
using PixelCrushers.DialogueSystem;
using PixelCrushers.Wrappers;

public class DialogInput : MonoBehaviour
{
    public InputMaster controls;

    void Awake()
    {
        controls = new InputMaster();
        //controls = new MyControls(); // Use the name of the script the Input System has generated.
    }

    void OnEnable()
    {
        //controls.Enable();
        InputDeviceManager.RegisterInputAction("Action", controls.Player.Action);
        InputDeviceManager.RegisterInputAction("Back", controls.Player.Back);
        Input.GetKeyDown(KeyCode.E);
        // (Note: Also assumes you've defined an action named Back for Input Device Manager.)
    }

    void OnDisable()
    {
        //controls.Disable();
        InputDeviceManager.UnregisterInputAction("Action");
        InputDeviceManager.UnregisterInputAction("Back");
        Input.GetKeyDown(KeyCode.E);
    }
}


Any idea what might cause this or how I can allow both keyboard, mouse and controller?
User avatar
Tony Li
Posts: 21961
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mouse and Joystick Input?

Post by Tony Li »

Hi,

Make sure your scene has an EventSystem GameObject, and that your dialogue UI's Canvas has a GraphicRaycaster component.

The script above shouldn't affect mouse input. However, you can remove this line:

Code: Select all

Input.GetKeyDown(KeyCode.E);
If that doesn't help, are there any errors or warnings in the Console window?
Post Reply