Select to view content in your preferred language

Setting position of location component not changing position

576
1
09-02-2022 12:45 PM
AlastorBloode
New Contributor

I'm very new to the world of GIS, though not to the world of Unity, and I cannot understand why this isn't working. It doesn't seem like anyone else has had issues, so I'm sure it's just something dumb that I'm doing, but any help would be appreciated regardless.

 

Currently, I'm just trying to put gameobjects down on the coordinates they are supposed to be on. 

private void Start()
    {
        ArcGISPoint startPoint = new ArcGISPoint((double)-90.5125122530634, (double)41.4975369998688, (double)210);
        SetLocation(startPoint);
    }
    public void SetLocation (ArcGISPoint location)
    {
        locationComponent.Position = location;
    }

 

Right now, all I want is for it to move to the coordinates I've set, but I can't get it to budge in any way at all. 

 

I am using the Esri.ArcGISMapsSDK.Components and Esri.GameEngine.Geometry libraries.

Thus far, it doesn't move, and if it does manage to move, it moves to lat 0 lon 0.

 

Can anyone tell me what I'm doing wrong?

0 Kudos
1 Reply
Matt_Nelson
Esri Alum

Sorry for the confusion from our API, the function you are using to create a point doesn't have a spatial reference, you are just using the x,y,z when you should use x,y,z,sr because it is missing the spatial reference (sr) what you have is invalid. You can check out our sample api script to see this in action.

0 Kudos