when the Application.Quit method is called, the game hangs for 3-4 seconds and then it closes, sometimes it restarts for some. How to fix it? UI objects are created when the game starts, tried to remove all objects from the scene and only then call this method, but the result is still the same ... I use 5.6.4p4. everything works fine with another project on this version.

    1 answer 1

    Probably, you perform some kind of heavy operations that take so much time when closing. On the top of the Window tab, turn on the display of the Profiler window - this shows the load of your application on the kernel / video / memory, etc. They can also be viewed from the editor, but the build will be cleaner, since the processes of the editor itself will be absent.

    Build a build with checked Development Build and Autoconnect Profiler checkboxes. When you start the application, the Profiler window will automatically connect to it. Close your application and see what happened in the profiler in the last seconds of its life. There you can see the peak loads, how much CPU time is spent on what methods, for example. Accordingly, if there is a sharp jump in the load, you will be able to see which methods are handled by this load.

    • My profiler hangs along with the game) removed all the logic that can load, the same thing. PS This phenomenon is not only on this phone - GR1995
    • @ GR1995, apparently, nevertheless, not all logic was removed. This kind of banal data storage may or may not be an infinite loop anywhere. If an empty project comes together and will work with a profiler, then the problem in the logic of the current project is M. Green