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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Input Maps don't filter out input events based on device

Discussion in 'Input System' started by AbsurdAndy, Jun 15, 2020.

  1. AbsurdAndy

    AbsurdAndy

    Joined:
    Dec 6, 2019
    Posts:
    47
    I have two inputs schemes;

    Scheme A: requires Oculus Rift controller
    Scheme B: requires HTC Vive controller

    Scheme A (erroneously) contains an action map for the HTC Vive trigger button. This action fires even though the map "requires" a rift.

    If I create a new Scheme, and set the new map to require oculus, I cannot add an action for the vive -- but if I create the action first then change the scheme requirements, the vive value sticks.

    Is this a bug, or am I doing something wrong?

    (I'm not using the PlayerInput class or anything, just using the .performed callback on the action. Otherwise no custom configs.)
     
    Last edited: Jun 15, 2020
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    ATM only PlayerInput automatically sets up "device restrictions". When using InputActionAssets directly or using the "Generate C# Class" workflow, there is currently no automatic support for control schemes. Adding this to "Generate C# Class" is high on the list. Has tripped up quite a few people and really isn't very obvious.

    To manually script this, check this post.