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

[solved]Input.location.lastData.altitude always zero in WP8.1 device

Discussion in 'Windows' started by takolittle, Mar 16, 2015.

  1. takolittle

    takolittle

    Joined:
    Mar 10, 2015
    Posts:
    3
    Hi, new to Unity3D (5) and still exploring..

    I write a very simple script that print the GPS location to screen (almost copy everything from the sample in documents),
    but somehow when i try on my WP 8.1 device, the altitude always return zero, latitude and longitude return correctly.

    I'm sure my device working with altitude, because i have tried few apps that download from store and they work.

    am I missing anything to make altitude report correctly?

    Unity5
    target platform: Windows Store, SDK Universal 8.1

    Thank you very much
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Have you enabled Location capability in Package.appxmanifest?
     
  3. takolittle

    takolittle

    Joined:
    Mar 10, 2015
    Posts:
    3
    Yes, latitude and longitude report correctly except altitude
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Could you please submit a bug with small repro attached?
     
  5. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Try taking the same values from Geolocator directly. No need to use Unity, just create simple XAML application. It's quite possible that altitude is not reported by device.
     
  6. takolittle

    takolittle

    Joined:
    Mar 10, 2015
    Posts:
    3
    as you suggested, i create a simple XAML app, and i just realize I was so stupid...
    during the testing i was at indoor, so the location info are obtained from cellular or wifi, not satellite,
    of course altitude is not available.

    Tomas: this is not a "bug", my bad:p
    i bring my phone outdoor and it work