Question by
rpeer · Apr 18, 2018 at 09:59 PM ·
instantiatecanvas
Instantiate Canvas with Lat Long showing up in same postition
I am trying to instantiate a canvas gameobject to specific lat longs I am getting from a db. When I execute the following code the canvas post in the same location and stay the same distance from the camera (instead of and staying in the location they instantiated. What am I missing?
for (int k = 0; k < postIdLatitudeString.Length; k++) { //removed -1 after length
//Lat Long
Lat = (float.Parse((postIdLatitudeString[k]));
Long = (float.Parse(postIdLongitudeString[k]));
dbLatLongArray = new Vector3 (Long, 0, Lat);
GameObject postGameObject = Instantiate (CanvasPost, dbLatLongArray, Quaternion.identity) as GameObject;
}
I am debugging the return on the DB lat and long and everything is coming in okay (format: XX.XXXXXX). I have tried converting the lat and long with a few different formulas with no luck.
Comment