Search Unity

Error of mssing ARRayCastManager

Discussion in 'Scripting' started by hoanganhphan91, May 6, 2022.

  1. hoanganhphan91

    hoanganhphan91

    Joined:
    May 3, 2022
    Posts:
    3
    Hi everyone,
    I am following this tutorial for trying to create an AR app.

    I am stucking at 3:42 with the error like that
    Assets\ARCursor.cs(9,12): error CS0246: The type or namespace name 'ARRayCastManager' could not be found (are you missing a using directive or an assembly reference?)
    This is how my code look like
    upload_2022-5-6_7-53-53.png
    I have already install some packages for AR
    upload_2022-5-6_7-54-31.png

    upload_2022-5-6_7-55-27.png
    So are there any recommendations to fix this?
    Thank you
     
  2. RadRedPanda

    RadRedPanda

    Joined:
    May 9, 2018
    Posts:
    1,647
    As the error suggests, it looks like you're missing a using directive. If you look at the top of the code in the video, on line 4, you can see they're using the namespace UnityEngine.XR.ARFoundation, which you didn't include in your code.
     
  3. hoanganhphan91

    hoanganhphan91

    Joined:
    May 3, 2022
    Posts:
    3
    upload_2022-5-9_7-33-12.png
    upload_2022-5-9_7-33-32.png

    Even I add "using UnityEngine.XR.ARFounndation;", I still can nnot load the script
     
  4. BABIA_GameStudio

    BABIA_GameStudio

    Joined:
    Mar 31, 2020
    Posts:
    497
    Probably because you have spelled the namespace wrong. It is not
    UnityEngine.XR.ARFounndation
    it is
    UnityEngine.XR.ARFoundation

    You have to make sure you spell everything correctly.
     
  5. hoanganhphan91

    hoanganhphan91

    Joined:
    May 3, 2022
    Posts:
    3
    upload_2022-5-10_13-8-41.png upload_2022-5-10_13-9-5.png
    Thank you for your suggestion but it still doesn't work.
    I just want to ask to import a package, Is just install it in pakage manager enough or should I do some thing more
     
  6. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,929
    Last edited: May 10, 2022
    Kurt-Dekker likes this.
  7. BABIA_GameStudio

    BABIA_GameStudio

    Joined:
    Mar 31, 2020
    Posts:
    497
    I think it is also because you have not spelled the type correctly either. You have
    ARRayCastManager
    , yet it is supposed to be
    ARRaycastManager

    I just installed the AR Foundation package and created your script and intellisense shows me that what you have is wrong.
     
    Cecily_14 and kingsoonkit like this.
  8. kingsoonkit

    kingsoonkit

    Joined:
    Jul 21, 2022
    Posts:
    2
    Nice, it works now. But why isn't it auto-filling the typo for us? Is it because i dont IntelliSense for Unity?