Search Unity

Navigation using GPS coordinates

Discussion in 'Navigation' started by hammu007, Mar 1, 2019.

  1. hammu007

    hammu007

    Joined:
    Dec 9, 2018
    Posts:
    1
    Hi There!
    i am new to game development and stuck in some issues related navigation. Actually what i want to achieve is that i am generating a target gps location within a radius of 50 meters from my current gps location, now the thing is that i want an arrow to point to that target location continuously as the user changes it's position or orientation. I have managed to calculate angle between current and target location and then point the compass arrow to that location but it doesn't work with orientation. What i know is that there is something to do with accelerometer of gyro to achieve my goal but im not able to figure it out correctly... Here is my code for compass/ nav arrow rotation. Any help will be appreciated.
     

    Attached Files:

  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    This isn't related to navigation, this forum is meant for Unity's AI NavMesh Systems.
    That said, my guess is you need to incorporate the user's forward vector in your calculation, which you will have to infer using the device's gyroscope.
    You might be better off bringing this issue over to the scripting or platforms (specifically for gyro input) fora.