Search Unity

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:
    5,060
  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:
    5,060
    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 :)