Search Unity

Unity Build lagging despite being okay in Editor

Discussion in 'Editor & General Support' started by DSilvandoBlade, Dec 31, 2020.

  1. DSilvandoBlade

    DSilvandoBlade

    Joined:
    Dec 22, 2020
    Posts:
    9
    Hi, I recently just finished making a game and I made a build to show my friends but I noticed that the build was lagging a lot, to a frame rate of around 5fps. This was weird because in the editor the same level would have a frame rate over 100fps. I know it isn't anything to do with my models or the scripts otherwise this would affect the game in the engine too. I don't know what I have to do. If anyone can help that would be great

    The version I'm using is Unity 2019.4.11f1 and I have HDRP if that changes anything.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Bust out the profiler window and profile the build (Windows -> Analysis -> Profiler) and find what's taking so long.

    One possible cause of a massive slowdown like you are seeing is doing "too much" in FixedUpdate(). Once you cross the saturation point for what can be accomplished in 0.020 of a second (20ms), you will get snail snot as Unity attempts to keep up with FixedUpdate().