0
\$\begingroup\$

I've made a test project to test the new Input system pointers (touch and mouse), in the editor, everything works perfectly however when I build the game they don't. it's like there is not an input system. I'm not sure if I'm missing a setting or something.

I've made simple sean where the Ui displays the available devices, whether they're enabled or not, and if a touch or mouse click detected it will display general information about it.

this is how it works in the editor:
enter image description here

And this is the android version, note that button press still works: enter image description here

I did not record the PC standalone version but it still does not respond.

this is the link to the build:
https://github.com/Venay/Input_test

this is the code I used and couple of screenshots of my settings:

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.InputSystem;

namespace Testing.InputDebugger
{
    public class InputDebugger : MonoBehaviour
    {
        PointerInput pointerInput;
        public Text inputText;
        public Text deviceText;
        public Text buttonText;

        private void Awake()
        {
            pointerInput = new PointerInput();
            pointerInput.General.Pointer.performed += ctx => OnPointer(ctx.ReadValue<myCompositData>());
            pointerInput.General.Pointer.canceled += ctx => OnPointer(ctx.ReadValue<myCompositData>());

            string text = "";

            foreach (var S in InputSystem.devices)
            {
                text += S.device + " : " + S.enabled + "  \n";
            }
            deviceText.text = text;
        }

        private void OnEnable() => pointerInput.Enable();
        private void OnDisable() => pointerInput.Disable();



        public void OnPointer(myCompositData data)
        {

            string n = "\n";
            string Press = "Press: " + data.Press.ToString() + n;
            string PressCount = "Press Count: " + data.PressCount + n;
            string Position = "Position: " + data.Position + n;
            string Delta = "Delta: " + data.Delta + n;
            string Radius = "Radius: " + data.Radius + n;

            string Tap = "Tap: " + data.Tap + n;
            string StartPosition = "Start Position: " + data.StartPosition + n;
            string StartTime = "Start Time: " + data.StartTime + n;

            string Scroll = "Scroll: " + data.Scroll + n;

            inputText.text = Time.time + n + Press + PressCount + Position + Delta + Radius + n + Tap + StartPosition + StartTime + n + Scroll;

        }

        public void OnButtonPress() => buttonText.text = "Pressed at:\n" + Time.time;
    }


}

enter image description here
enter image description here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The was a bug in the input system where builds only supported "x86_64". Go to your project settings and make sure that is explicitly set.

It is marked as fix now https://issuetracker.unity3d.com/issues/windows-ds4-controller-doesnt-work-in-built-scene

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Can you reproduce the key points from that link here in your answer, so it's preserved even if the link rots in the future? \$\endgroup\$
    – DMGregory
    Apr 30, 2021 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .