Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Direct touch interactions breaking when using 2 canvases

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

  1. JakeS_97

    JakeS_97

    Joined:
    Jun 13, 2013
    Posts:
    9
    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

    Deltigre

    Unity Technologies

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