Working on an open world project, roughly 8x8km playable area, and I've been fighting floating point precision issues for two weeks straight. You know the ones: objects start jittering when you're far from world origin, physics colliders go slightly wrong, particles drift sideways for no reason. Classic stuff.
The go-to solution is origin shifting, periodically recentering the world around the player so coordinates stay small and precise. Conceptually simple. In practice it's a bag of edge cases that keeps growing every time I add a new system.
Problems I keep hitting:
- Joints and constraints between objects snap during the shift if you get the order of operations even slightly wrong
- Particle systems using world-space positions get teleported unless you explicitly offset every emitter
- Third-party cloth sim stores positions internally and has no idea the shift happened, it just silently diverges
- UI elements reading world positions (map markers, floating damage numbers) need their own correction pass
Unreal handles a lot of this with Large World Coordinates in UE5, double precision under the hood, which is genuinely solid if you stay in-engine. I'm in Unity though, and the community origin-shifting scripts I've found handle maybe 70% of the cases. The other 30% is a different bug every time.
My current setup is a global WorldOriginShift event that every system subscribes to and applies its own position correction. It works but it's fragile as hell. Every new system I add has to remember to subscribe, and I always forget one, and then something starts drifting 6km from spawn and I spend an afternoon figuring out which system it was.
Is there a better pattern for this in Unity specifically? Some architecture that makes new systems opt-out instead of opt-in? Or does everyone just accept a certain amount of manual wiring and move on?
