Player transform resets to 0 when hitting around 800

Include the following details (edit as applicable):

  • Issue category: Lightship Maps
  • Device type & OS version: iOS
  • Host machine & OS version: Windows
  • Issue Environment : On Device
  • Unity version: 2021.3.37f1

Description of the issue:
So currently I am trying to despawn objects when the player gets too far, was trying to set that distance to 1550 (about double the radius of my interactable area around the player) but it seems that when I start to near around 800 in any given direction in unity the player gets reset to 0 so my player never really hits that 1550 threshold so while the lightship map shows they are in a different area, the prefabs im trying to spawn get dragged with them to the new area. From what ive read online in similar cases (not lightship related, but unity in general) its due to a script, so my question is, is lightship the cause of this and if so can it be shut off or is there an alternative way to keep track of how far the spawned object really is? The spawned objects in this case arent related to any POIs they are randomely spawned within a radius of the player and are things like resources/troops/etc. so nothing to do with any real latitude/longitude locations

Hello Nolan,

There is one field related to Lightship. Try checking the maximumMapOffset serialized field in the LightshipMapView component. This variable sets the maximum distance the map is allowed to move away from the origin (in meters). If the map’s center moves further than this limit, all map tiles and objects placed on the map will be moved back to the scene’s origin.

While there’s no event that can be hooked into when that happens, you could check your logs to see if **Log.Info($“Repositioning the map ({distanceSquared} squared meters from the origin)”); ** shows up. Seeing this would indicate that the issue is due to the maximumMapOffset.

Yes this was the cause, thank you. With it resetting the map to 0, it was never hitting my destroy distance threshold. This does bring up one more question then related to this, would having this maximum offset increased or even commented out bring about any performance issues? I cant imagine a user travelling an insane distance (and my project is mainly just to help my portfolio so wont be used by many if at all) so im sure a player wouldnt ever be going farther than a few thousand away from origin before closing the game, so if an great distance from unity origin does cause performant issues, I might be able to ignore it

There wouldn’t be any performance impacts from increasing the max offset. However, the biggest consideration would be related to precision. If the map offset gets too large, Unity gets more and more imprecise, so there might be visual artifacting, etc.