How to control ECS physics update rhythm

Hey Guys!

I currently have a huge ecs scene with more than 50k entities. Here the physics system takes up to 10ms to update per cycle. But as the entities move slow longer update cycles to reduce CPU consumption would be a real pickup.

What I read so far is that ECS has a different fixedUpdate system, having something to do with RateUtils!?
Class RateUtils.FixedRateSimpleManager | Entities | 1.0.16

From an iSystem I probably need to grab the FixedStepSimulationSystemGroup and adjust the time - but how?

    var system=state.World.GetExistingSystem<FixedStepSimulationSystemGroup>();
    RateUtils.FixedRateSimpleManager... ???

Thanks for your help!

Ok, now managed to adjust the update rate using SystemBase. Here the code - sufficient to call once in OnCreate:

var group = World.DefaultGameObjectInjectionWorld.GetExistingSystemManaged<FixedStepSimulationSystemGroup>();
group.RateManager = new RateUtils.FixedRateSimpleManager(0.10F);
```
1 Like