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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Problem with missing assembly reference in XR Interaction Toolkit 2.0.2

Discussion in 'XR Interaction Toolkit and Input' started by LoneSurvivor82_1, Aug 4, 2022.

  1. LoneSurvivor82_1

    LoneSurvivor82_1

    Joined:
    Jul 6, 2021
    Posts:
    9
    Hi everyone,

    I have big problems with the XR Interaction Toolkit Package. At the moment 1.0.0-pre.2 is installed in my Unity 2020.3.33-project. I have a script which uses the XRRig. Everything is fine.

    But when I try to install a higher version like 2.0.2 where XRRig is deprecated, I get the following exception:
    upload_2022-8-4_17-58-52.png

    If I try to replace XRRig by XROrigin and add a using, the namespace is not recognized:

    upload_2022-8-4_17-59-31.png

    For testing purposes I also tried to reimport the Project in Unity 2022.1.11 where all packages should be fine but the error is the same.

    I already tried to regenerate project files but without success.

    This is the manifest.json:
    upload_2022-8-4_18-5-7.png

    Can somebody help please?
     
  2. langokalla

    langokalla

    Joined:
    Aug 4, 2020
    Posts:
    22
    If your script is in a subfolder of an AssemblyDefinition you have created, you need that AssemblyDefinition to reference the AssemblyDefinition of Unity.XR.CoreUtils. I personally have no problem using the XROrigin when the references is set up correctly.
     
  3. langokalla

    langokalla

    Joined:
    Aug 4, 2020
    Posts:
    22
  4. LoneSurvivor82_1

    LoneSurvivor82_1

    Joined:
    Jul 6, 2021
    Posts:
    9
    Thanks for your message. We aren't using any custom AssemblyDefinitions for our code. Do I have to add a reference somehow to the predefined assembly Assembly-CSharp.dll?
     
  5. langokalla

    langokalla

    Joined:
    Aug 4, 2020
    Posts:
    22
    Creating AssemblyDefs. can be a bit tricky the first time, but this tutorial is really good:
    .

    You might get a lot of errors the first time, but when everything has been referenced in the end, all should be fine. It is a really good way of structuring code and dependencies. However, I believe it is a bug in the end. It should not be necessary to go through this to use the XROrigin, but it does not hurt to learn new things :)