Search Unity

Other Unity AR Foundation Raycast onto TrackedImages not working on IOS

Discussion in 'AR' started by punikol, Nov 22, 2021.

  1. punikol

    punikol

    Joined:
    Jan 15, 2018
    Posts:
    4
    Dear Unity Community,

    I am currently developing an AR Application where the User can scan in Images from a Book and geats read lines corresponding to the images, to Identify which image the User is aiming at I am using the ARRaycastManager Raycast to prevent overlap to nearby images. This is working fine on several Android Devices but refuses to work on IOS. The other AR functionality works also fine on IOS (Images are being recognized) but I just don't get any raycast hits whatsoever. Am I missing something obvious?

    :)

    Code (CSharp):
    1. if (arRaycastManager.Raycast(screenCenter, rcHits, TrackableType.Image))
    2.         {
    3.          
    4.             foreach (ARRaycastHit hit in rcHits)
    5.             {
    6.                 raycastIdText.text = hit.trackableId.ToString();
    7.                 foreach (ARTrackedImage image in currentTrackedImageList)
    8.                 {
    9.                     if (image.trackableId == hit.trackableId)
    10.                     {
    11.                         trackableNameText.text = image.referenceImage.name;
    12.                     }
    13.                 }
    14.             }
    15.         }
    16.         else
    17.         {
    18.             raycastIdText.text = "NONE";
    19.         }
     
  2. punikol

    punikol

    Joined:
    Jan 15, 2018
    Posts:
    4
    Ok I just didn't manage to solve it at all, resorted to instantiating Boxes with colliders in AR tracking on the images with the images' sizes and raycasting onto them.