I read almost every tutorial, but nothing is working. I can easily drag and drop it in unity with zero code, and using AR foundation and AR code i can see it in AR, but I want to do it through code, so I can spawn them easier. I tried everything, like this:
var objAnchor = ARAnchorManagerExtensions.AddAnchor(aRAnchorManager, earthPosition.Latitude, earthPosition.Longitude, earthPosition.Altitude, Quaternion.identity); Instantiate(GeospatialAssetPrefab, objAnchor.transform);
(this code is returning null, and i dont know why)
or same thing but ARAnchorManager instead ARAnchorManagerExtensions, but none of this methods work, nothing is spawned.
I can do it like GameObject obj = Instantiate(GeospatialAssetPrefab, new Vector3(0, 0, -1), Quaternion.identity); but that new vector is something with no connection to world, it is basically unity coordinates, and i want to insert lat, long and altitude. Can someone please help me <3