Floating Origin script can't stop animation from shaking!

Hi there guys, I remember there was a floating origin script on the wiki that could stop animations from shaking out of floating point area! But now it doesn’t work with Unity 2017.3. I mean It moves world but can’t effects on animations! animations still shakes.

I mean this script.

// FloatingOrigin.cs
// Written by Peter Stirling
// 11 November 2010
// Uploaded to Unify Community Wiki on 11 November 2010
// Updated to Unity 5.x particle system by Tony Lovell 14 January, 2016
// fix to ensure ALL particles get moved by Tony Lovell 8 September, 2016
// URL: http://wiki.unity3d.com/index.php/Floating_Origin
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Camera))]
public class FloatingOrigin : MonoBehaviour
{
    public float threshold = 100.0f;
    public float physicsThreshold = 1000.0f; // Set to zero to disable
    #if OLD_PHYSICS
    public float defaultSleepVelocity = 0.14f;
    public float defaultAngularVelocity = 0.14f;
    #else
    public float defaultSleepThreshold = 0.14f;
    #endif
    ParticleSystem.Particle[] parts = null;
    void LateUpdate()
    {
        Vector3 cameraPosition = gameObject.transform.position;
        cameraPosition.y = 0f;
        if (cameraPosition.magnitude > threshold)
        {
            Object[] objects = FindObjectsOfType(typeof(Transform));
            foreach(Object o in objects)
            {
                Transform t = (Transform)o;
                if (t.parent == null)
                {
                    t.position -= cameraPosition;
                }
            }
            #if SUPPORT_OLD_PARTICLE_SYSTEM
            // move active particles from old Unity particle system that are active in world space
            objects = FindObjectsOfType(typeof(ParticleEmitter));
            foreach (Object o in objects)
            {
                ParticleEmitter pe = (ParticleEmitter)o;
                // if the particle is not in world space, the logic above should have moved them already
        if (!pe.useWorldSpace)
            continue;
                Particle[] emitterParticles = pe.particles;
                for(int i = 0; i < emitterParticles.Length; ++i)
                {
                    emitterParticles[i].position -= cameraPosition;
                }
                pe.particles = emitterParticles;
            }
            #endif
            // new particles... very similar to old version above
            objects = FindObjectsOfType(typeof(ParticleSystem));      
            foreach (UnityEngine.Object o in objects)
            {
                ParticleSystem sys = (ParticleSystem)o;
        if (sys.simulationSpace != ParticleSystemSimulationSpace.World)
            continue;
        int particlesNeeded = sys.maxParticles;
        if (particlesNeeded <= 0)
            continue;
        bool wasPaused = sys.isPaused;
        bool wasPlaying = sys.isPlaying;
        if (!wasPaused)
            sys.Pause ();
        // ensure a sufficiently large array in which to store the particles
        if (parts == null || parts.Length < particlesNeeded) {      
            parts = new ParticleSystem.Particle[particlesNeeded];
        }
        // now get the particles
        int num = sys.GetParticles(parts);
        for (int i = 0; i < num; i++) {
            parts[i].position -= cameraPosition;
        }
        sys.SetParticles(parts, num);
        if (wasPlaying)
            sys.Play ();
            }
            if (physicsThreshold > 0f)
            {
                float physicsThreshold2 = physicsThreshold * physicsThreshold; // simplify check on threshold
                objects = FindObjectsOfType(typeof(Rigidbody));
                foreach (UnityEngine.Object o in objects)
                {
                    Rigidbody r = (Rigidbody)o;
                    if (r.gameObject.transform.position.sqrMagnitude > physicsThreshold2)
                    {
                        #if OLD_PHYSICS
                        r.sleepAngularVelocity = float.MaxValue;
                        r.sleepVelocity = float.MaxValue;
                        #else
                        r.sleepThreshold = float.MaxValue;
                        #endif
                    }
                    else
                    {
                        #if OLD_PHYSICS
                        r.sleepAngularVelocity = defaultSleepVelocity;
                        r.sleepVelocity = defaultAngularVelocity;
                        #else
                        r.sleepThreshold = defaultSleepThreshold;
                        #endif
                    }
                }
            }
        }
    }
}
/*
Addendum from DulcetTone on 22 April 2018: a user named Marcos-Elias sent me a message with an optimization he found helpful on recent versions of Unity which include the new "SceneManager" functionality.
He suggests replacing this fragment of my code:
Object[] objects = FindObjectsOfType(typeof(Transform));
      foreach(Object o in objects)
      {
          Transform t = (Transform)o;
          if (t.parent == null)
          {
             t.position -= cameraPosition;
          }
      }
with the following code, to avoid having to process ALL objects to find the root objects
for (int z=0; z < SceneManager.sceneCount; z++) {
       foreach (GameObject g in SceneManager.GetSceneAt(z).GetRootGameObjects()) {
           g.transform.position -= cameraPosition;
       }
}
I have not use this myself, as yet, but I wonder if an additional optimation would be the following, to update only the active scene:
foreach (GameObject g in SceneManager.GetActiveScene().GetRootGameObjects()) {
           g.transform.position -= cameraPosition;
}
*/

Animations still shaking badly even when I use Floating Origin script. Does anybody know why?

No one have a solution for this old issue? If I can’t walk more than 4000m in my game because of shaking animations then how we can build open world games with Unity?

Anybody knows that’s going on?

@Crossway

Did you ever solve this, we 3x3 terrain, and as soon as a player is around 1000-2000 units away from origin, we get a very noticeable shake on all the animations.

Surely a player should be able to move a few thousand units? I want to avoid using any crazy origin re center scripts as the game is authoritative and multiplayer, so that would be a headache.

Using Unity 2017.4.2f2

Absolutely! I travel to Mars and beyond (i.e 10^10 and more), and only use single precision.

Some physics and animations are highly sensitive to lower resolution error dues to distance from origin. I have done a number of experiments to measure this and one report is here:
https://www.researchgate.net/publication/336533410_Floating_origin_fighting_cubes_battle_for_positional_invariance
I used a value of 3000 for threshold.
This first of two videos relevant to this is on the link below. In this one, there is an animation and collision error at after 1700m from the origin. Only one degree of freedom: x axis.

https://www.youtube.com/watch?v=vbIb9dh1f7o

The second, with two degrees of freedom, shows issues earlier:

https://www.youtube.com/watch?v=80W113eL6wQ

The short answer is that there is no one threshold distance from the origin that will work for all situations. There will always be random issues occurring, in some situation, in error sensitive calculations for no apparent reasons. Try your luck by reducing the threshold.
I don’t have this issue because I don’t use a threshold.