Search Unity

Feedback Interaction Layer Mask improvement

Discussion in 'XR Interaction Toolkit and Input' started by freso, Apr 23, 2021.

  1. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    73
    I am not a fan of you abusing Unity layers for this field.
    1. Layers are precious and I don't want to create a Layer which isn't needed.
    2. Confusing/misleading. It's easy to assume the objects need to have this layer set on the GameObject.

    It's a hassle creating a modular pre-setup XRRig for including in other projects, as the Unity layers need to be setup and probably the interaction layers needs resets for new layer values.

    I would instead prefer you having the interaction layers in some kind of global XR profile, where we can add our own interaction layers, separate from the Unity layers. Easily exported and imported to other projects, without changing Unity layers.

    This change doesn't need to be a big problem, as you could just import Unity layers to interaction layers when upgrading.
     
    Alex-CG, davl3232 and jdh5259 like this.
  2. jdh5259

    jdh5259

    Joined:
    Sep 14, 2017
    Posts:
    20
    Running into a similar issue as well. Between physics and visibility both using a variety of layers, I am running very low on available layers. I am comfortable with the interactions using bitmask comparisons for determining whether an interaction is valid but I don't think using the Unity layers is the right answer.
     
  3. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    231
    Very well stated, and I agree with your assessment. You can override the methods which use the Interaction Layer Mask like
    XRBaseInteractor.CanSelect
    and
    XRBaseInteractable.IsSelectableBy
    to add your own compatibility comparisons, but the package should definitely be changed to decouple it from the Physics layers as there is no real need to use the same source.

    I've recorded it as a feature request for a future version of the package.
     
    freso likes this.
  4. jdh5259

    jdh5259

    Joined:
    Sep 14, 2017
    Posts:
    20
    Thanks for taking that into consideration and providing a possible workaround.
     
  5. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    73
    Thanks. Does future version mean after 1.0.0 final?

    I've been holding off on the VR part of my project for a while, but this is starting to become an issue, and wondering if I should start implementing a workaround or wait a few more months.
     
  6. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    231
    We are targeting the 2.0 release for the layer change rather than backporting it to a 1.x version of XRI. It may not be within a few months, so you may be better off implementing your own solution. We do plan on having it automatically upgrade to a new serialized field where it initially copies the project layers, but I can't predict when you would run out of layers in your project if you continue using the existing method.
     
    jdh5259 and freso like this.