XRBaseInteractable calls FindCreateInteractionManager() in Awake

This is the Awake() function in XRBaseInteractable:

    protected virtual void Awake()
    {
        // If no colliders were set, populate with children colliders
        if (m_Colliders.Count == 0)
        {
            GetComponentsInChildren(m_Colliders);
            // Skip any that are trigger colliders since these are usually associated with snap volumes.
            // If a user wants to use a trigger collider, they must serialize the reference manually.
            m_Colliders.RemoveAll(col => col.isTrigger);
        }

        // Setup the starting filters
        m_HoverFilters.RegisterReferences(m_StartingHoverFilters, this);
        m_SelectFilters.RegisterReferences(m_StartingSelectFilters, this);
        m_InteractionStrengthFilters.RegisterReferences(m_StartingInteractionStrengthFilters, this);

        // Setup Interaction Manager
        FindCreateInteractionManager();
    }

Awake shouldn’t be doing stuff like finding and creating stuff. This breaks multi-scene setups where InteractionManagers get created in the wrong scene (despite another scene having one but hadn’t loaded/awaken yet)

What’s frustrating about this is because XRBaseInteractable is a base class for all interactables, this forces us to pull the package into our project so we can remove this line from the code. (It was either that, or find multiple instances of InteractionManager and destroy the ones we don’t want then fix up interactables to point at the correct interaction manager)

Please test XRI in multi-scene setups where you might have one scene for persistent stuff such as the XR rig and Interaction Manager, and another scene for content or game level stuff that has interactables.

Hello,

I would like to ask you to report this via the bug reporter so that we could take a look and please attach your project or a stripped down one where the issue is reproducing so that we could verify that it’s not project specific and accurately test it.

You can do so by doing the following:

  1. Open the project where the issue is reproducing
  2. Open the Bug Reporter from the Tool Bar (Help → Report a Bug…)

Additionally please attach the URL to this Discussions thread to the description.

Thank you in advance!

It’s up to you if you want this issue addressed. You can file it yourself and deal with whatever QA people who responds.

After having my last few bugs closed for whatever reason, I’m pretty done with the bug reporting tool and will just post on these forums where it’s publicly visible about stuff like this.