Search Unity

Feedback Automatic references and Prefabs

Discussion in 'XR Interaction Toolkit and Input' started by Alex-CG, Mar 3, 2021.

  1. Alex-CG

    Alex-CG

    Joined:
    May 10, 2015
    Posts:
    11
    I've been modifying a lot of prefabs lately and commonly, the process goes like this:
    1. Modify the prefab in the isolated prefab editor
    2. Go back to the scene with placed prefabs
    3. Open each of the placed preabs "Overrides" section of the object
    4. Look for the changes I need to revert, which luckily consists in just clicking "Revert All", as the prefab has the updated configuration for the objects.
    However what I've found is a lot of changes to my interactables placed in the scene, made by the scripts on its own assigning the previously placed XR Interaction Manager automatically. This makes me go over each of the possibly modified objects in the hierarchy to check for possible changes, a check that wouldn't be needed without these automatically assignated Interaction Managers.

    While the automatic assignation on placement seems like a convenience, I think it is actually innecessary, as the objects also look for the XR Interaction Manager on Play and in the latest versions the Toolkit even creates a new XR Interaction Manager if it's not present.

    So I think maybe the automatic assignation of XR Interaction Manager when placing Interactables or Interactors should (and safely, could) be removed.
     
  2. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    231
    If you don't have any other overrides in the scene to the prefab instance, you shouldn't need to revert it after making changes to the prefab since it will just inherit those changes. But yes, the Interaction Manager being set to a scene reference will add noise to the override dropdown and make it more difficult to see what else is different with respect to the prefab. In the case of multiple XR Interaction Manager components being present in the set of loaded scenes, the reference will need to be set to disambiguate between them for the behavior to know which to automatically register with since otherwise it will just use the first one found.

    I'll see what we can do to better define the find strategy at runtime and keep it performant so we can avoid doing the assignment in Reset unnecessarily. Thanks for the feedback!
     
    Alex-CG likes this.