All systems are duplicated 2-5 times in the profiler. Is this how it should be? For example, in frame 1 the SimulationSystemGroup runs in 10ms, in frame 2 it takes 20ms (all systems are repeated 1 time), in frame 3: again 10ms, and so on. Is there any idea how to fix this?
This doesn’t seem normal. How are you bootstrapping your system creation?
Looks like because of this. Without this system it works fine, but I need physics independent from framerate. I tried to change fixedDeltaTime to DeltaTime - the same.
public class FixedStepPhysicsSystem : SystemBase
{
private bool once = false;
protected override void OnUpdate()
{
if (once == false)
{
FixedRateUtils
.EnableFixedRateWithCatchUp(World.GetOrCreateSystem<SimulationSystemGroup>(),
UnityEngine.Time.fixedDeltaTime);
once = true;
}
}
}
The built-in physics systems are already run in a fixed time-step. They run in the FixedStepSimulationSystemGroup.
2 Likes