How to use GeoToWorldPosition method
How to place AR object at specific longitude and latitude in real world , Im using worldscaleAR I know GeoToWorldPosition method ,and I read https://www.mapbox.com/mapbox-unity-sdk/api/unity/Mapbox.Unity.Utilities.Conversions.html , but I still don't konw how to use it.
AND do I let the object walk on the map randomly,I have read https://blog.mapbox.com/placing-ar-portals-all-over-the-world-pt-2-1470b0f70281 , but he used sdk 1.3 .I used sdk 1.4 and followed his tutorial and use the same script.But it didn't work at the end. I konw it's a basic problem, I 'm a unity beginner hope anyone can help me plz.
Hi @willychang21, the conversion methods can be found from the AbstractMap class. You can reference that to get access to GeoToWorldPosition method.
@lauri-rustanius @jordy-isaac I use spawn on map at specific position ,it work successfully ,but the original spawn appear on the player here is the result I record. https://www.youtube.com/watch?v=-OpU7jRZBRc what did I miss??
another Q : how do i let an object appear in an area randomly and how do I let them appear when the user close to the target at a distance of 100 meters??
Hard to tell. Can you show a snippet of the code you're using? You want to probably place the objects after the map has called the OnInitialized event.
Also, it's good to snap the spawnable objects transform.position.y on the BoundedPlane.center.y position, so they won't be hovering on air. You can find the event calls for BoundedPlanes in ARInterface.planeAdded and ARInterface.planeUpdated.
@lauri-rustanius @jordy-isaac I had modify successfully ,but the map will visualized in the ar camera as a plane, and when I moved the map ,it would be moved out then I could see the ar camera from the map here's the link I demo: https://www.youtube.com/watch?v=HgSd7Yu4HwQ&feature=youtu.be
@willychang21 Please let us know if you are still having trouble with this after upgrading to v1.4.1. Thank you!
hello, i don't know how exactly to use GeoToWorldPosition method to place AR objects at specific longitude and latitude