Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Foundation AR, ARSessionOrigin doesn't reconize the Raycast method?

Discussion in 'AR' started by miranoren, May 17, 2019.

  1. miranoren

    miranoren

    Joined:
    Dec 4, 2016
    Posts:
    1
    Hi,

    So I just started production with AR Foundation, but I get that the class Foundation AR, ARSessionOrigin class doesn't recognise the Raycast method. According to their documentation it should do. Does anyone have any ideas.
    Ive tried the script on 2018.3.8 and 2019.1.3f1. I get other method to work such as MakeContentAppearAt. But the rays cast method is nowhere to be found (for me). please help!
     
  2. yolon3000

    yolon3000

    Joined:
    Aug 1, 2018
    Posts:
    4
    same question,can any one explain it ?
     
  3. n1ghtbird

    n1ghtbird

    Joined:
    Nov 6, 2018
    Posts:
    6
    Same issues on Unity 2019.1.0f2 with ARFoundation 2.1.

    I get the following errors appearing:
    'ARSubsystemManager' is missing in the current context
    'ARPlaneManager' does not contain definition for 'GetAllPlanes'
    'AROrigin' does not contain definition for 'Raycast'

    Have tried resetting the packages but to no avail.
     
  4. n1ghtbird

    n1ghtbird

    Joined:
    Nov 6, 2018
    Posts:
    6
  5. KelsoSharp

    KelsoSharp

    Joined:
    Feb 24, 2018
    Posts:
    3
    You need to create a raycast manager and use it instead of the ARSessionOrigin like this

    var hitsList = new List<ARRaycastHit>();
    var rayCastMgr = GetComponent<ARRaycastManager>();
    rayCastMgr.Raycast(screenCenter, hitsList, TrackableType.Planes);
     
  6. ricardovalquin

    ricardovalquin

    Joined:
    Feb 19, 2019
    Posts:
    1
    Hi guys, thank you so much for the explanation, but a question for @KelsoSharp , calling the raycast manager and sending the TrackableType.Planes gives me an error:
    The name 'TrackableType' does not exist in the current context
    Is something that I need to import/define in the global scope?
    thank you so much