Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[ AR Foundation ] ScreenPointToRay is laggy on AR Session camera

Discussion in 'AR' started by valentin-simian, Feb 24, 2020.

  1. valentin-simian


    Nov 16, 2012

    I'm using the ScreenPointToRay function to cast a ray from a position on screen to a 3D object, and then using LineRenderer to draw a line between those two objects.

    In the AR Session camera, when I move the phone, the LineRenderer drawing doesn't update fast enough and lags. In my case, I have a RectTransform with an Image, to the center pivot of which the LineRenderer receives its first point ( the second is the 3D object ). The Line Position 0 is behind the Image, but due to the lag, the origin appears outside the Image.

    Furthermore, applying this same technique in regular 3D Space, or Vuforia Model Tracking does not lag.

    I'm setting positions via SetPositions, and tried running this in Update and LateUpdate with no resolve.