Seeking Solutions for Syncing Origin in Multiplayer Setup with Cesium API: Unity Coordinate Discrepancies Issue

I have a question about the Cesium API, I checked the API and also past discussions on the Cesium community forums and could not find an answer about it.

I’m encountering an issue in our multiplayer system where I pause origin shifting for users when they fly to a certain location. However, sometimes (happens on rare occasions) each user experiences a slightly different shift in the origin point. This discrepancy affects the placement of custom 2D/3D objects and the synchronization of Unity coordinates among users, leading to inconsistencies.

Attempting to synchronize the origin point at runtime is ineffective, as the ‘Place Origin Here’ feature is only accessible in the Editor, and there seems to be no method to communicate or pass Unity coordinates to Cesium for origin synchronization. My goal is to ensure that the Unity coordinate system remains consistent for all users in relation to the geographical reference data and sub-scenes.

Does anyone have suggestions on how to address this issue or know of a method to synchronize the origin point for all users in real-time, ensuring consistent Unity coordinates in relation to the geographical data? Thanks ahead of time!

I don’t know much about multiplayer, but the globe location of the Unity coordinate system is defined by the the ecefX, ecefY, and ecefZ properties of the CesiumGeoreference. If you find these to be out of sync on the clients, calling SetOriginEarthCenteredEarthFixed on one of them, passing the ecefX/Y/Z from the other, should fix it up. As to how they get out of sync in the first place, I unfortunately don’t know. If you figure out why that happens, let us know.

1 Like

Thank you, @Kevin_Ring, for your input! It seems from your explanation that the ecefX, ecefY, and ecefZ properties in the CesiumGeoreference define the globe location in relation to the Unity coordinate system through Earth-Centered, Earth-Fixed (ECEF) coordinates. However, it appears these properties may not directly address our specific need for shifting the origin to a particular point in our multiplayer setup, which is currently not an available feature.

We’re looking to precisely reposition the origin point within the Unity environment to maintain consistent spatial referencing across all users, which seems to be a different challenge than synchronizing the ECEF coordinates. Would there be any other approach or workaround within Cesium or Unity that could help achieve this kind of dynamic origin repositioning? Any further guidance or suggestions would be greatly appreciated!