Immersive Media Design

AR Book Map Part 3

Connecting Mapbox & Unity

Tess Stevens
3 min readApr 13, 2020

This week I focused on reading about the Mapbox SDK for Unity and trying to connect my Mapbox account data with my Unity file. Some things worked and some things didn’t, per usual.

Stuff that worked:

As a reminder, after last week’s discovery of the Mapbox SDK for Unity, my Unity file looked like this:

This week I started by reading through and trying out some of the Unity documentation on Mapbox. It seemed like some of the documentation hasn’t been recently updated, because a lot of the wording in the documentation differed from what I was actually seeing in Unity. I tried the steps laid out in both of these two pages. The Custom Maps instructions were very helpful, the Add Markers instructions were not. Or rather, I’m not sure if the Add Markers documentation will be helpful, because I’m not sure I was doing it right.

The documentation helped me figure out where and how I needed to input the data from Mapbox. From what I can tell, there are two different places that I had to input my own Mapbox data.

First, I had to go into my Mapbox account and copy the style URL and paste it into the the Image box in the Abstract Map section of the Map game object.

Next, I had to copy the tileset URL from Mapbox and paste it into the Tileset ID box in the Map Layers section of the Map game object.

And voila my globe suddenly had the same styling and the same markers as my Mapbox book map. Hooray!

Stuff that didn’t work:

I also tried to convert my Unity file into an AR app by adding an AR Session and AR Session Origin and converting the camera to the AR camera, but I think I did something wrong because when I tried that everything went black. And when I tried to undo the AR changes, the file started acting up. There are a bunch of errors, and when I try to zoom into the scene, everything goes gray. I was going to try to change or get rid of the default Mapbox text popup, but now I can’t even zoom in close enough to edit it. 😩

Things I need help with next:

  1. How do I fix the file so I can zoom in (and get rid of the errors)?
  2. How do I successfully convert my file into an AR app without the errors?
  3. How do I go about making the Mapbox data points clickable, and make something pop up?

--

--