I need to make a AR type game in just a week. And I need the coordinates because it needs to be an Online game, like pokemon go, but you have to see other players. Do anyone know how to get the exact coordinates of a phone?
You would need a native extension for that.
Has anyone done that?
I don’t think so.
Shit…
Is your phone iOS or Android?
Android
Check my Defold-Gyro extension. It’s a good start if you want to build a GPS extension.
I have tried the Gyro extension, but I can’t get it to work on my Samsung Galaxy J5.
Edit: I tried “Android sensor box” and my phone dosen’t seem to have a Gyroscope sensor.
You can modify it to use it as a base to add GPS support. You’ll need to add the permissions and checks too.
https://developer.android.com/training/location/retrieve-current.html
How do you edit existing Native Extensions in Defold? I have found the script but I can’t edit it, can you edit Native Extensions scripts in real time or do you have to restart everytime you want to test it?
If you have it as a library listed in your game.project you’ll have to remove that and copy and paste the folder into your actual project files. Then you can edit those files.
Since the native extension scripts are built on the Defold servers you have to rebuild to test changes to the native extension. You should read over all of the files carefully first so you understand how everything works to a degree, then begin to make changes.
Please also refer to the manual on native extensions as it describes how it all comes together.