Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug [Bug report] PlayerInput send messages from another Action map

Discussion in 'Editor & General Support' started by dimeodd, Nov 9, 2021.

  1. dimeodd

    dimeodd

    Joined:
    Dec 21, 2019
    Posts:
    3
    how to repeat a bug:
    > Create new project (2019.4.18f)
    > Install "Input System" from Package Manager (1.0.2 or 1.2.0)

    > You can import testProject.unitypackage to skip blue text

    > Create new Input Actions asset (LMB > Create > Input Actions)
    > Set Action maps (img1) img1.PNG
    > Create new script
    Code:
    //*******************************************************
    using UnityEngine;
    using UnityEngine.InputSystem;

    public class Test : MonoBehaviour
    {
    int i = 0;

    void OnMove(InputValue value)
    {
    Debug.Log(i++ + "_" + value.Get<Vector2>().magnitude);
    }

    void Update()
    {
    i = 0;
    }
    }
    //*******************************************************

    > on scene create any UI object
    > in GameObject "EventSystem" press button "Replace with InputSystemUIInputModule" and do this
    > upload_2021-11-9_12-11-29.png
    > Create a GameObject
    > in the GameObject add PlayerInput script and "Test.cs" script
    upload_2021-11-9_12-15-12.png


    > Preparation completed!
    > Press "Play" and press "D" or move LeftStick (Gamepad)
    > We have a call from another ActionMap
    upload_2021-11-9_12-22-55.png

    > (in Edit mode) If we change DefaultMap to "UI" in PlyerInput it work correct
     

    Attached Files: