- Home /
AR + GPS location based object/ collider
Dear reader, I typed this question two times and I was almost done, but because of clicking a link in this editor where I typed this question in, or closing the page on accident, I'm kinda sick of it to retype it again but here we go.
I'm currently working on a game that uses GPS location and AR as a student.
I want to make a game that is GPS location based. You must walk around and once you are close to a specific GPS coordinate you should be notified, and the scene or game should switch over to AR. You should see an object that needs to be placed on a GPS coordinate as well so you can walk around the object and it will stay on the exact spot as it is to someone else on their phone.
It will be an outside 'Game' so I can't place any objects on the ground like a piece of paper. If I could do that. Vuforia was my way to go. I am trying for over 3 weeks now and still got no result.
I have tried many things like AR-Kit, AR-Foundation, AR-Core.
I even tried third-party plugins like: MapBox, Vuforia and a AR-Kit + AR-Core instruction.
MapBox: Has GPS tracking and uses Google's satellites if I had it read correctly. But has no good AR function to place an object on a GPS location. You can do it with a Tiff image in the MapBox studio but no FBX file or something "Unity" stuff like a collider or box object. So, I can't create an event or call up a method with this.
Vuforia: Does have great AR support but nothing with GPS. It can only scan an image that looks the same as the one you have placed in the database from the Vuforia website. But you can't place it on a GPS location.
The instruction: Is very outdated and is made in Unity 2017. In the video's description on YouTube he let us know that he won't remake it because it's not an easy task to make it. He left he's GitHub project public, but I don't think this is a solution for me to get this done in a week or two. The creator is using GameSparks to create events but it's so outdated I kinda went off track on this one. It was way too complicated.
Another way?
I did find another way and that's the AR+GPS asset. But it's expensive. Almost every tutorial for AR + GPS location-based objects are using this asset. But there must be a way to make it free right?
Does anyone have any idea or can give me tips to make this in 2019? There must be a way that's free.
Answer by dmit99_ · Oct 01, 2019 at 02:22 PM
I have been working on this project for a few weeks now. I find out that AR core / Ar Foundation and Mapbox worked great for once and choose that sollution to work with. It worked once and tried to build it. But had to turn my pc off because I had to go and that corrupted my unity I guess.
So it gave me a value error and had to remake the project for the 5th time with bad result every time. My AR is working propperly but as soon as I add MapBox SDK to it. My AR camera will be black and AR won't be turned on ever again.
I still can see my object in the scene but can't walk arround my object or go closer to it.
I think ARcore/ ARFoundation might have the same values as MapBox uses and in that case it might conflict each other.
To try to fix this issue,
1, I deleted the mapbox AR folder.
2, Checked settings and build settings a hundred times and changed them to try out if it worked then.
35 builds later still black screen result.
I tried finding another similar thing like Mapbox and found Google maps has its own SDK but the map wasn't as I hoped it was so it is no option I guess.
Any tips?
EDIT:
I finaly managed to fix this issue and it works!
Once you have your UnityScene loaded up. Install the Mapbox package. Uncheck the folders from GoogleAR, the two UnityAR folders and the MapboxAR folder. So you only have the MapBox folder and the thirdparty folder left.
Next up install the ARcore / ARkit (Depends if you want to work with Android or IOS.) And install the ARFoundation in the package manager tab from Unity. Create your default scene for mapbox (by using the mapbox prefabs) and the scene for your AR by:
Hierarchy -> rightclick -> XR -> AR session.
And add the: Hierarchy -> rightclick -> XR -> AR session origin.
Add your object in the AR scene and there you go! Mapbox with ARcore!
Enjoy your PokemonGo game.
Hi, I don't know if this works yet, but finding someone having the same issue is already a satisfaction.
So what you are saying is, there is an order to install all these packages ?
For my case, AR Object display ok using GPS coordinates. I apply a color on each AR items and this is ok.
But as soon as I add Mapbox (Only Mapxbox and thirdpartyAssets) things getting bad. I lost the color.
Adding all the Mapbox packages causes conflicts between Mapbox AR and aready installed packages (AR Fundations, AR Core/Kit)
So I don't know what to do. Use mapbox render my AR Object black. Even with the color applied). If I remove Mapbox Assets folder, color is back All good.
I don't understand why there is an "install order"...
Answer by DirtyFred · Mar 08, 2021 at 03:26 PM
Hi,
I have been trying to do this. Just importing the Mapbox unity package works fine. I have tried the examples and they are working good.
The problem is the World scale AR is not accurate. Sometimes it works, most of the time it doesnt. It places the objects not in the correct Lat Long coordinates in the AR world.
Does anyone know a good solution for this?
Thank you