Search Unity

Change Gameobjects position from database

Discussion in 'Scripting' started by jorientje1992, Feb 11, 2016.

  1. jorientje1992

    jorientje1992

    Joined:
    Feb 1, 2016
    Posts:
    2
    Hello Everybody,

    I'm trying the following (i'm kind of a noob still, hope its possible):

    I want my GameObject (a sphere) to read GPS coordinates from a database on internet and change its position accordingly. However, these coordinates are being updated and so I want my GameObject to read the coordinates every few seconds and update its position.

    I'm thinking the coordinates from the website should first be stored in a database, but not sure which database is most useful for this and how to read the positions from this database in c#. I've googled but am not finding the right solution for my specific problem. Hope it's clear what my goal is!
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    do you need to know what the previous GPS positions were? if you just need to know the latest there isn't a need to store the previous requests, just parse the latest one and perform whatever updates you need to.
     
  3. jorientje1992

    jorientje1992

    Joined:
    Feb 1, 2016
    Posts:
    2
    No i don't need to know the previous GPS positions. Do you know the code to parse these coordinates?
     
  4. BluHornet

    BluHornet

    Joined:
    Feb 23, 2015
    Posts:
    40
    why do you need a database if you do not need to know the previous positions? I do not understand what the point of the database is? Why don't you pull the GPS cords from the site and convert to Vector3 and then lerp the object to that new position? The database sounds like extra work.