Details: Issue category: Lightship Maps Device type & OS version: Android / iOS Host machine & OS version: Windows Issue Environment : Unity “Game” tab ARDK version: Not installed AR Foundation version: 5.0.7 Lightship Maps version: 0.4.0 Unity version: 2022.3.5f1
Description of the issue
Hello Lightship Maps developers team and Lightship community!
I am developing a game with AR Foundation on Unity for Android and iOS, probably in the future I will migrate to ARDK, at present I want to use Lightship Maps to show the position of the player and other elements.
Top-Down Camera Sample
(Sample Projects | Niantic Lightship)
After dowloading the “Top-Down Camera Sample” and test it I tried to replicate the same in an empty scene but I have not succeeded.
Creating a scene from scratch and adding a “LightshipMap” prefab I can run the game and the map looks correct on the Game tab of Unity.
But when adding an “Orthographic Camera” prefab and link it with the “LightshipMap” the map is no longer displayed when pressing play.
I have to deactivate the “Orthographic Camera” and run the game, the map will show normally.
Then I have to activate manually the “Orthographic Camera”, but I cannot move the map or change zoom level.
What is going on? Am I missing something?
I have also made a copy of the sample to investigate.
If I delete the “Orthographic Camera” and put another new and make the link the game will run normally. But if I delete the “LightshipMap” and put another new and make the link the problem is the same as I describe before.
Why?
Render-to-Texture Sample
(Sample Projects | Niantic Lightship)
Suits for my need of a minimap in one corner of the screen, but I want to expand to full screen when the player press it.
I have tried to replicate the behaviour of this sample in my scene without success, similar problems as the other sample.
But I am not sure what this sample want to show us.
We have to show “TexturedQuad” in front of the camera or we have to use “MapPanel” on the “Canvas”?
Or the two option are necessary to obtain a minimap with “MapPanel” and later make a full screen map with the “TexturedQuad”?
Because the explanation of the sample is focused on the “RawImage” and does not explain that the “ToggleMapButton” shows “TexturedQuad” in front of the camera. By the way, the “MapPanel” gameobject cames with a “Image” component instead of a “RawImage” I guess it’s a mistake.
Questions
Can anyone help me to reproduce the samples behaviours in a new scene?
What is the appropiate way to have a minimap centered in the user position in one corner of the screen but expand it to full screen to move the map and change level zoom?
Thank you for your patience! Are you able to provide more detailed steps for me to reproduce this issue or supply a minimal reproduction project for me to take a look at?
1.- Create a new scene in unity editor.
2.- Add lightshipmap with:
Lightship → Maps SDK → Add Lightship Map To Scene
3.- Add orthographic camera with:
Packages → Lightship Maps SDK → Sample Assets → Cameras → OrthographicCamera
4.- Link the lightship map with orthographic camera inside “Orthographic Camera Controller” script.
5.- Add eventsystem with:
UI → EventSystem
6.- Press play in the unity editor. The map is not visible.
Some errors appears:
[E] [Platform] Assert hit!
You might consider changing to use the debug versions of the niantic platform libraries for more context on this error
UnityEngine.Debug:LogError (object)
Niantic.Platform.Debugging.Unity.UnityLogStream:LogMessage (string,Niantic.Platform.Debugging.LogLevel,string) (at C:/Users/Desktop/UD/RWFPS 2.01.08/Assets/Samples/Lightship Maps SDK/0.4.0/Render-to-Texture Sample/Common/UnityLogging/UnityLogStream.cs:39)
Niantic.Platform.Debugging.LogService:LogToStreams (string,Niantic.Platform.Debugging.LogLevel,string)
Niantic.Platform.Debugging.LogService:LogMessage (string,Niantic.Platform.Debugging.LogLevel,string)
Niantic.Platform.Debugging.Log:Error (string)
Niantic.Platform.Debugging.Assert:Fail ()
Niantic.Platform.Debugging.Assert:That (bool)
Niantic.Lightship.Maps.SampleAssets.Cameras.OrthographicCamera.OrthographicCameraController:Start () (at ./Library/PackageCache/com.niantic.lightship.maps@633b3bbcda9e/SampleAssets/Cameras/OrthographicCamera/OrthographicCameraController.cs:42)
[E] [Platform] Assert hit!
You might consider changing to use the debug versions of the niantic platform libraries for more context on this error
UnityEngine.Debug:LogError (object)
Niantic.Platform.Debugging.Unity.UnityLogStream:LogMessage (string,Niantic.Platform.Debugging.LogLevel,string) (at C:/Users/sib_a/Desktop/UD/RWFPS 2.01.08/Assets/Samples/Lightship Maps SDK/0.4.0/Top-Down Camera Sample/Common/UnityLogging/UnityLogStream.cs:39)
Niantic.Platform.Debugging.LogService:LogToStreams (string,Niantic.Platform.Debugging.LogLevel,string)
Niantic.Platform.Debugging.LogService:LogMessage (string,Niantic.Platform.Debugging.LogLevel,string)
Niantic.Platform.Debugging.Log:Error (string)
Niantic.Platform.Debugging.Assert:Fail ()
Niantic.Platform.Debugging.Assert:That (bool)
Niantic.Lightship.Maps.SampleAssets.Cameras.OrthographicCamera.OrthographicCameraController:Start () (at ./Library/PackageCache/com.niantic.lightship.maps@633b3bbcda9e/SampleAssets/Cameras/OrthographicCamera/OrthographicCameraController.cs:42)
7.- Press pause in the unity editor.
8.- Deactivate the OrtographicCamera gameObject.
9.- Press play in the unity editor. The map is visible in the “Scene” tab of Unity, but the “Game” tab is not correct.
10.- Activate the OrtographicCamera gameObject. Now the “Game” tab shows the map but we cannot drag over the map to see other streets.
Thank you for taking the time to write out those steps. It looks like the child object of the OrthographicCamera prefab – Camera was supposed to be shipped with a script attached to it but it didn’t come through. On my end I had a “Missing (Mono Script)” in the script section of the Inspector. To remedy the situation, I edited the prefab so that the Camera object no longer had a script attached to it. This issue should be resolved in a future release of Maps.
I was able to reproduce the behavior of the sample after following your instructions. On my end I saw that the Camera had a script component attached to it but Unity was unable to locate it. Yet, when I ran the app in the editor the Universal Additional Camera Data script was added and everything worked fine.
Please note that I created a Universal Render Pipeline 3D project – “URP (3D)” – and I started off by deleting the default Main Camera. Next, I added the Lightship Map, the OrthographicCamera prefab, and an EventSystem. Other than fixing the missing script issue with the Camera, I just hit run and it ran as expected. Make sure you delete the extra camera in your scene and tag the Lightship Camera that came in the OrthographicCamera prefab as the “Main Camera.”
Lastly, the error output you provided points to a line that checks if “Center Map at Origin” is enabled. Could you experiment by toggling it and running your app in the editor?