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.

Question Direct touch interactions breaking when using 2 canvases

Discussion in 'VR' started by JakeS_97, Mar 3, 2023.

  1. JakeS_97


    Jun 13, 2013
    Hi everyone,

    I am working on an application using the Oculus SDK and hand tracking. I have 2 main canvases that I'm working with, in world-space, that the user can direct touch with hand tracking. However, when I use canvas A to open canvas B, and then interact with canvas B, I get the error "ArgumentException: An item with the same key has already been added. Key:XXXXXXXXX" and "KeyNotFoundException: The given key 'HandPokeInteractorRight (Oculus.Interaction.PokeInteractor)' was not present in the dictionary.".

    This is driving me crazy, can anyone shed some light on this?

    Edit: I thought this was being caused by buttons specifically, but that's not the case. It seems to be whenever I use a UI element to load into a different scene that this issue occurs. If I interact with both canvases, avoid the button that loads a new scene (doing that from ContextMenu stuff instead) it works fine in the new scene.

    Edit 2: Putting the scene change button back on Canvas A (so canvas A to open canvas B, select the scene to load, and load via a button on canvas A) is working without issue.
    Last edited: Mar 3, 2023
  2. Deltigre


    Unity Technologies

    Sep 13, 2022
    I'm having trouble following, can you provide your project or a minimal repro and also which version of Unity you're using?