Search Unity

The game is very laggy(again)

Discussion in 'General Graphics' started by MikeyJY, May 27, 2020.

  1. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    This is a continuation of:
    https://forum.unity.com/threads/random-frame-drops-on-start.898826/#post-5904449
    I decied to create another thread because I know that on older thread I will receive no answer.

    I solved all errors and now I have only two:
    upload_2020-5-28_1-36-19.png



    Same random behaviour. I don't know what to do.

    Profiler on laggy playmode:
    upload_2020-5-28_1-37-22.png


    Profiler on no-lag playmode:
    upload_2020-5-28_1-38-17.png


    I noticed that when there is no lag the CPU is 11 - 12 ms. When is lag the CPU is 700 - 800 ms and 600 are for "EditorLoop". I don't understand why is RANDOM?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    You should switch the Profiler target from Playmode to Editor to see what is going on inside the EditorLoop. The difference could be down to a number of things, but we can only guess as long as you only show cropped screenshots of the Hierarchy or Timeline view of the Profiler, while Profiling Playmode so that we can't see the EditorLoop contents. The documentation says as much about the EditorLoop too btw
     
  3. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Thanks, and sorry if I duplicate posts, but as I said no one revisit older threads. The main question is why it has a random behaviour?
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    New messages make them bubble to the top again. You could have tried that first.

    Anyways, no idea why it's random. It could also be reliable and you just didn't figure out the factor that makes it trigger. Maybe it's due to the selection? In one screen you have the terrain selected... I don't know and can't tell you anything really from these screenshots, you need to Profile the Editor to get any idea on the what and why. Speculation is not a very effective troubleshooting technique here.
     
  5. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Thanks. A lot of users reported "EditorLoop" causing spikes and all of them received the same answer: "Your game won't have this spikes when you build it"
     
  6. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    @MikeyJY
    Hmmm. Looking at the two errors...

    I was going to say, that you were probably using the non convex mesh collider, in a way that Unity does not support. Or probably this is a unity bug. But looking at the error, I would say, that you're either using the non convex mesh wrong, or if you are using it correctly, then this somehow seems to be, an odd unity physics bug issue.

    As for the texture rectangle problem, I found this old post.
    Check the solution in the last post at the bottom.
    https://forum.unity.com/threads/texture-rectangle-is-out-of-bounds.61575/
    This might be a long tiring way to solve that problem, but it might work in your case. Thanks to trickyspark for coming up with this solution.

    Hope that helps.
     
    Last edited: Jul 25, 2020
    MikeyJY likes this.