Select to view content in your preferred language

Migration Unity SDK 1.5 to 2.1 - basemap not showing

676
16
Jump to solution
3 weeks ago
LukeMcBeath1
Emerging Contributor

I have a mobile project that is currently using v1.5 of the Unity SDK.

I am migrating to v2.1 but when I update the package the basemap is not displaying.

I am using the sat image basemap:

https://www.arcgis.com/home/item.html?id=c7d2b5c334364e8fb5b73b0f4d6a779b

The project is currently using a legacy API key but changing to a new rotating key has the same issue.

 

Other game objects on the map render fine.

 

Are there things that need to be done to the project/map/camera when migrating from 1.x to 2.x?

 

 

 

0 Kudos
1 Solution

Accepted Solutions
and1
by Esri Contributor
Esri Contributor

Hi @LukeMcBeath1 , after upgrading a project from v1.5 to v2.1, the ArcGIS Camera component may appear disabled in the editor. You can manually enable it and re-save the scene, and it should then work correctly when entering play mode in v2.1.

and1_0-1759353525602.png

 

View solution in original post

0 Kudos
16 Replies
and1
by Esri Contributor
Esri Contributor

Hi LukeMcBeath1, the new API key and the legacy one should both work. How did you set up the basemap layer (through the Map Creator UI or through C#)? I tested the basemap you provided in 2.1, it works on my end.

 

 

0 Kudos
LukeMcBeath1
Emerging Contributor

Map Creator UI

0 Kudos
LukeMcBeath1
Emerging Contributor

LukeMcBeath1_0-1757628657525.png

 

0 Kudos
and1
by Esri Contributor
Esri Contributor

Thanks for your screenshot. We have updated the Authentication workflow.

Under your Basemap section in your inspector (using SDK 2.1), you can change the Authentication dropdown option from "None" to "API Key". This should make the basemap display. It seems that you have manually change this dropdown option when you updated to 2.1.

 

and1_0-1757632516735.png

and1_1-1757632662688.png

 

 

0 Kudos
LukeMcBeath1
Emerging Contributor

In the last screenshot I had reverted from 2.1 back to 1.5.

When using the 2.1 library the auth type is set to API Key

 

The scene viewer shows the basemap, but when I press play it just shows the brown unity ground

 

LukeMcBeath1_0-1757635355326.png

 

 

0 Kudos
and1
by Esri Contributor
Esri Contributor

So the map renders in the editor view but not in the play mode? Can you check the camera position? Or you can try to go to the camera tab, and click "Align with View" so the camera will align with your current view in the editor, then hit "Play".

0 Kudos
LukeMcBeath1
Emerging Contributor
We have a script that sets the camera location to look down on our "player"
The player objects render OK
 
public void UpdateCameraLocation()
        {
            if (arcGISCamera != null && lastLocation != null) {
                var cameraLocation = arcGISCamera.GetComponent<ArcGISLocationComponent>();          
                cameraLocation.Position = lastLocation.ArcGISPointWithAltitude(cameraPosition.CameraAltitude(playerAltitude));
                cameraLocation.Rotation = new ArcGISRotation(lastLocation.Heading, cameraPosition.Pitch, 0);
                // logLocation("== UpdateCameraLocation", cameraLocation.GetComponent<ArcGISLocationComponent>());
            }
        }
0 Kudos
and1
by Esri Contributor
Esri Contributor

Do you mind sharing a video clip so we could better see what's going with the map when you hit "Play"? Was the map showing before you hit the "Play" in Editor mode? Also did the camera code that you provided work for you in v1.5?

0 Kudos
LukeMcBeath1
Emerging Contributor

https://youtu.be/4_foJB6G73I

PC is performing poorly after Windows 11 update 😞

 

Yes this code works with v1.5

0 Kudos