I wanted to place gameobject at some coordinate position at runtime, I have coordinates and wanted to spawn a gameobject and place it at some coord, but when I change it with LongitudeLatitudeHeight property of CesiumGeoReference, it takes it to some very far place and cant be seen.
public void InstantiateProps(GameObject propPrefab)
{
Transform props = Instantiate(propPrefab).transform;
props.parent = geoReference.transform;
props.position = Vector3.zero;
props.localPosition = Vector3.zero;
props.rotation = Quaternion.Euler(-90, 0, 0);
props.GetComponent<MeshRenderer>().material.color = color;
address = location.text;
address = address.Replace(" ", "+");
map.GetCoordinateData(address);
CesiumGlobeAnchor anchor =props.gameObject.AddComponent<CesiumGlobeAnchor>();
double3 coordinates = new double3(map.GetLongitude(), map.Getlatitude(), map.GetHeight());
anchor.GetComponent<CesiumGlobeAnchor>().longitudeLatitudeHeight = coordinates;
anchor.Restart();
//props.position = Vector3.zero;
//props.localPosition = Vector3.zero;
//double3 pos = geoReference.TransformEarthCenteredEarthFixedPositionToUnity(coordinates);
//props.transform.position = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
}
This is the transform position after spawning