Search Unity

Huge Physics.Simulate spikes despite NO physics in scene -- what's happening?

Discussion in 'Physics' started by Paniku, Jan 22, 2016.

  1. Paniku

    Paniku

    Joined:
    Apr 11, 2013
    Posts:
    24
    I've turned down everything in the Physics setting as uch as I could - all the layers are unchecked, the solver count is as low as it can go, etc, and yet I'm still getting "Physics.Simulate" spikes despite having no rigidbodies or colliders in my scene. My game is entirely made with the UI.

    As an example of a spike, one I'm looking at right now has Physics.Simulate taking 23.44ms of CPU time, which was HALF of the entire time spent in that frame (and 3/4 of the other half was the profiler-specific stuff).

    Does anyone know if Physics.Simulate does anything special that's not documented? Why is it spiking so high?
     
  2. Rycons

    Rycons

    Joined:
    Nov 23, 2013
    Posts:
    31
    I've done some test of my own recently since sadly we have also been experiencing heavy spikes in our builds with the recent Unity 5 versions. The following issue can be replicated in a fresh project using a scene with just a plane in it.

    I'll be doing further testing later on today on various work machines to see if the issue persists on different types of hardware.
     
    Last edited: Jan 26, 2016
  3. toreolsensan

    toreolsensan

    Joined:
    Nov 17, 2015
    Posts:
    6
    Any more information about this? I also have huge Physics.Simulate spikes (up to ~50 ms/frame), however my game is a 2D physics game and the profiler appears reports Physics2D usage separately. Furthermore, spikes happen when the game is just idling without any movement. This is tested on a Galaxy Nexus Android phone.

    When running in the editor, I don't see such spikes for some reason, but Physics.Processing reliably use 7-9% CPU for some reason. Lots of calls to PhysX.Sc::Scene.* in here.