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 XROrigin Namespace Error?

Discussion in 'VR' started by Ravioli_Dish, Jan 7, 2022.

  1. Ravioli_Dish

    Ravioli_Dish

    Joined:
    May 11, 2021
    Posts:
    1
    Trying to declare XROrigin like so:

    private XROrigin xROrigin;

    But am met with the following error:
    Assets\CharacterMoveHelp.cs(8,13): error CS0246: The type or namespace name 'XROrigin' could not be found (are you missing a using directive or an assembly reference?)

    I am genuinely stumped. I have the XR toolkit in the script and have called it properly in all other aspects of the script. Any ideas? See the attached image for the full script.
     

    Attached Files:

  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
  3. LoneSurvivor82_1

    LoneSurvivor82_1

    Joined:
    Jul 6, 2021
    Posts:
    9
    And where can I find the Package? Package Manager doesn't list it.

    I have added it manually to the packages manifest.json but this can't be the official way:

    upload_2022-2-24_11-6-56.png
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    Add using Unity.XR.CoreUtils maybe.
    Or properly link visual studio, so you can simply see what VS/Unity suggests as fix
     
    xeniaeo likes this.
  5. LoneSurvivor82_1

    LoneSurvivor82_1

    Joined:
    Jul 6, 2021
    Posts:
    9
    This was the first I tried :)
    Neither VS nor ReSharper suggest something that would resolve the problem.
     
  6. Stunbox

    Stunbox

    Joined:
    Jan 8, 2014
    Posts:
    2
    Instead "XROrigin" use "ARSessionOrigin", this have the same parameters :)