Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Unity physics work even i delete physic step GO from editor.

Discussion in 'Physics for ECS' started by seojihyuk, Jun 26, 2022.

  1. seojihyuk

    seojihyuk

    Joined:
    Sep 19, 2014
    Posts:
    30
    Hello, guys.
    I've recently upgraded my project to Unity Physics package 0.50. after i converted, I've got huge performance drop (From 60 FPS to 20 FPS) and I found that inside FixedStepSimulationSystemGroup All system run multiple time in 1 frame moveover Even I deleted physics step GO which is converted to entity from scene, the unity physics is working.
    My entities related to physics are about 500s.
    Why is it happeing? Can you explain some reason that make BuildPhysicsWorldSystem work 5 times a frame?
    profiler.png
     
  2. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    If you upgraded from pre-0.5, i.e. you didn't have FixedStep before, then what you see is by design. If an actual physics step takes longer than a defined FixedStep duration then it chokes on and FPS crashes.

    If you don't need fixed updates then simply
    World.DefaultGameObjectInjectionWorld.GetOrCreateSystem<FixedStepSimulationSystemGroup>().FixedRateManager = null;


    Otherwise, I'd like to know the solution myself - how to cap the maximum rate but not the minimum, so spikes do not cause the missed updates to pile up.