Hi everyone,
I’m encountering an issue when using the longitudeLatitudeHeight
property of CesiumGlobeAnchor
to programmatically place objects on the globe at runtime.
I’m receiving latitude, longitude, and altitude data from an external server. My workflow is as follows:
- Receive lat/lon/alt data.
- Instantiate a new GameObject with a
CesiumGlobeAnchor
component.
- Set the
CesiumGeoreference
object in my scene as the parent of the newly instantiated GameObject.
- Set the
longitudeLatitudeHeight
property of the CesiumGlobeAnchor
to the received lat/lon/alt values.
The problem is that the resulting position of the GameObject (visible in the Unity hierarchy) does not match the lat/lon/alt values I’m setting. For example, I’m inputting values around (35, -120, 0), but the object’s transform appears to be located somewhere closer to (-60, -146, 100) (approximately). This puts them in a completely different area of the globe.
Has anyone else experienced this behavior? I’m unsure if I’m missing a step or misunderstanding how longitudeLatitudeHeight
is supposed to work.
Any help or suggestions would be greatly appreciated!
Thanks,
Richard
Hi @rcapewell, welcome to the community!
First, I’d double-check the order in which you’re passing in the cartographic values. Longitude is first, followed by latitude, so the desired position should be (lon, lat, height)
.
If the above doesn’t help, then there may be a bug withCesiumGlobeAnchor
. We’d appreciate more information to reproduce the bug, such as:
- What versions of the Unity Editor + Cesium for Unity are you using?
- Please provide minimal step-by-step instructions for reproducing the issue.
Thank you!

I wanted to provide an update: I’ve identified and resolved the issue. The problem was with the order of latitude and longitude in my data source. Our system was providing the coordinates as (Latitude, Longitude), and when I was converting the values to be used with Cesium, I failed to swap them around correctly. I was accidentally creating the longitudeLatitudeHeight
with the longitude and latitude values inverted.
Everything is working as expected now that I’ve corrected the order. Thanks to everyone who offered suggestions!
Minor Feedback for the Cesium Team
While this was my mistake, I think it would be clearer from a development side to have the old deprecated method (e.g., anchor.SetPositionLongitudeLatitudeHeight(double longitude, double latitude, double height)
) instead of the longitudeLatitudeHeight
property might help to prevent similar errors in the future. A method call would provide a more explicit opportunity to double-check the order of the arguments. This is especially true since many common mapping tools (like Google Maps) display coordinates in (Latitude, Longitude) order. While I understand the property is more concise, a method could potentially improve usability and reduce confusion.
Thanks for the quick response anyway,
Richard