Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

All Systems are repeating multiple times in Profiler

Discussion in 'Entity Component System' started by kro11, Mar 27, 2022.

  1. kro11

    kro11

    Joined:
    Sep 23, 2019
    Posts:
    95
    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?

    Screenshot_1.png

    Screenshot_2.png
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    This doesn't seem normal. How are you bootstrapping your system creation?
     
  3. kro11

    kro11

    Joined:
    Sep 23, 2019
    Posts:
    95
    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.

    Code (CSharp):
    1.  
    2. public class FixedStepPhysicsSystem : SystemBase
    3. {
    4.     private bool once = false;
    5.  
    6.     protected override void OnUpdate()
    7.     {
    8.         if (once == false)
    9.         {
    10.             FixedRateUtils
    11.             .EnableFixedRateWithCatchUp(World.GetOrCreateSystem<SimulationSystemGroup>(),
    12.             UnityEngine.Time.fixedDeltaTime);
    13.             once = true;
    14.         }
    15.     }
    16. }
     
  4. TRS6123

    TRS6123

    Joined:
    May 16, 2015
    Posts:
    246
    The built-in physics systems are already run in a fixed time-step. They run in the FixedStepSimulationSystemGroup.
     
    Anthiese and Krajca like this.