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

Question Input.location.Start doesn't work correctly if I check ARCore on XR Plug-in Management

Discussion in 'AR' started by omanuke, Sep 25, 2021.

  1. omanuke

    omanuke

    Joined:
    May 5, 2017
    Posts:
    30
    I wanna get GPS value in AR scene but Input.location.Start seems not to work correctly if I check ARCore on XR Plug-in Management in project settings.
    It works like a charm when ARCore is unchecked.

    Unity ver is 2020.3.19f1.
    AR Foundation, AR Core, ARKit ver is 4.1.7.

    This is repro code for this issue.
    If you start project, you can see 3 buttons and text.
    If you don't have permission, press req to get permission.
    If you have permission isEByUser reveals isEnabledByUser and hasPermission reveals
    Permission.HasUserAuthorizedPermission(Permission.CoarseLocation) should be true.
    When you're running this project on android with checked for ARCore, If you press start while you have permission, status should change to Running but it remains Stopped.
    If you uncheck ARCore, same operation will change status to Running.

    I misunderstand something? or Is this a bug?
    https://github.com/omanuke/TestARCoreLocation
     

    Attached Files:

    Last edited: Sep 25, 2021
  2. r2d2b22

    r2d2b22

    Joined:
    Jun 7, 2022
    Posts:
    1
    I have a problem, too.
    But there's no law to die

    - Kim Chul-soo

    if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation))
    {
    Permission.RequestUserPermission(Permission.FineLocation);
    }