Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Raycasts in AR ??

Discussion in 'AR' started by lkdin, Dec 2, 2019.

  1. lkdin

    lkdin

    Joined:
    Jun 29, 2018
    Posts:
    10
    Hey AR Devs,

    I'm having following problem and i wonder, if anyone has a suggestion for it.

    I have a normal ARFoundation scene where i want to click on objects in the 3D scene.

    So naturally i would use a RayCast like this: Ray ray = arCamera.ScreenPointToRay(touch.position)

    But it doesn't work correctly. When trying to click the collider there is always an offset, so instead of clicking on the object i have to click next to it. The collider is wrong on any object i try to click on.

    If anyone has a suggestion on how to tap or click on objects in AR please let me know.

    Thanks!
     
  2. mandivision

    mandivision

    Joined:
    Mar 17, 2019
    Posts:
    8
    This video has a method that works: