Hi all,
I had an unity project in which i create some models dynamically, but after I insert map into the project, I can't found the gameobject created by me, anyone can tell me why?
thanks in advance
jeff
Hi, I'm thinking of two possibilities:
1. the game object is not a child of the arcgismap object, then the camera doesn't show it.
2. the game object location doesn't have an arcgis location component or is position is far away the origin and extends of the map
I hope it helps!
mbd
Thank you mbd, it's really helpful.
But are all the game objects in arcgismap project be children of arcgismap?
I paste my code here as follows,
public void OnCreateCubeButtonClicked(){ Instantiate(myCube, new Vector3(0, 0, 0), Quaternion.identity); GameObject arcgixMap = GameObject.Find("ArcGISMap"); if (arcgixMap != null) { myCube.transform.parent = arcgixMap.transform; }
HPTransform hpTransform = myCube.GetComponent<HPTransform>(); if (hpTransform != null) { hpTransform.LocalPosition = new Unity.Mathematics.double3(-2871978.3959205807, 4132157.7468104535, -4529007.4551753243); hpTransform.LocalScale = new Unity.Mathematics.float3(100000, 100000, 100000); }}
Anything wrong?
You didn't add the location component to your go.
No, I didn't add component HPTransform, because myCube is a prefab, and I've added the HPTransform component in the inspector.
Another problem is I set the position of hpTransform like this,
hpTransform.LocalPosition = new Unity.Mathematics.double3(-4451191.8873, 6562076.953, 1046025.930);
button when playing, the position of hpTransform is (6378137, 0, 0)
Any clue?
Jeff
嘿!哥们,我搞定了!需要你的Game object在ArcGISMap的层级下面,Game object需要添加两个组件HPTransform、ArcGIS Location。可以通过ArcGIS Location组件修改经纬度。
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.