EnableFixedRateWithCatchUp makes editor hang forever when entering Play mode

I want to quickly do some tests where I need physics & other systems to run on fixed update, so I create a monoBehaviour that does this:

    void Start()
    {
        if(EnableFixedUpdate)
        {
            _simulationGroup = World.DefaultGameObjectInjectionWorld.GetOrCreateSystem<SimulationSystemGroup>();
            FixedRateUtils.EnableFixedRateWithCatchUp(_simulationGroup, Time.fixedDeltaTime);
        }
    }

However, this seems to make Unity freeze forever when entering Play mode. The scene is not heavy at all and basically just has one moving cube.

Am I doing anything wrong? Entities 0.10.0 preview6

Go look at the source code and have a laugh as it’s pretty obvious why this causes infinite loops (it does not do what you either, it never skips frames.)

If you want a fixed update for physics you’ll have to write your own callback because the 2 they provide do not do what you want.

1 Like