Select to view content in your preferred language

accessing a game object's location

529
3
Jump to solution
09-20-2022 04:09 PM
HacksHaven
New Contributor II

When using the ArcGIS Location Component I can see the latitude and longitude in the inspector window. However, how do I access these values from script?  I'd like to know the current position of the player.

0 Kudos
1 Solution

Accepted Solutions
Matt_Nelson
Esri Contributor

GO.GetComponent<ArcGISLocationComponent>().Position.X or Y

View solution in original post

3 Replies
Matt_Nelson
Esri Contributor

GO.GetComponent<ArcGISLocationComponent>().Position.X or Y

wanxuan
New Contributor

Why did I report an error "The type or namespace name 'ArcGISLocationComponent' could not be found"😭

0 Kudos
Matt_Nelson
Esri Contributor

Add 
using Esri.ArcGISMapsSDK.Components;


0 Kudos