Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Build is faster than editor

Discussion in 'Editor & General Support' started by futurevlad2_unity, Dec 3, 2020.

  1. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    I built my game for the first time and this happened : https://youtu.be/ORz7YhVU1jg
    Notice the upload date of the vid, I took a break because of that very issue, I came back to it a couple days ago, I made a whole new unity project, imported all the packages, models, materials, made new scripts in which I copied the code in, remade the whole scene, and its STILL faster. I'm very lost.

    I'm doing things that should prevent this issue, like multiplying with delta time where needed, turning on vsync (suggested in unity discord), I don't know what else to do.

    I also want to say this is my first time using the new input system.

    Links to google drive of the files:
    Old project files : build.
    New project files : build.
     
    Last edited: Dec 3, 2020
  2. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,315
    Running your build, it seems to run as intended on my machine. It doesn't seem like the build itself is causing your problem.

    If you create a minimal project (maybe just throw some physics objects into a scene so something is moving), does that project have the same issue? Or is it only this project with all the assets and scripts and such?
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,988
    i tested new project in editor and as a build, feels like same speed in both. (and arrows fly with the same speed too)..
     
  4. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    Hm yeah, it is way faster. I made a cube fall on to a plane, it was way faster in build than editor.
    What would be a fix for this?
     
  5. m0guz

    m0guz

    Joined:
    Mar 4, 2015
    Posts:
    31
    Try adding
    Application.targetFrameRate = 60f;
    inside Start() method.

    Also check if Vsync enabled for your build.exe from AMD/Nvidia control center.
     
  6. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    How exactly?
    I think i found it, its Off
     
  7. m0guz

    m0guz

    Joined:
    Mar 4, 2015
    Posts:
    31
  8. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    I also think its not just the physics, but everything, in editor the crosshair size changes slower than in the build
    That fixed everything... Why did that fix everything? Does everyone who run the build have to do those steps?
     
  9. m0guz

    m0guz

    Joined:
    Mar 4, 2015
    Posts:
    31
    There are bunch of settings in Unity to minimize this issue like Applicaton.targetFrameRate = 60f; or Vsync to Every V Blank. There is also "gotcha" option. You probably missed the selected quality option in Quality settings.

    upload_2020-12-3_16-29-23.png

    That green tick show you which quality level will be applied on build. Probably Vsync is set to Don't Sync in that "green" quality level in your project.
     
  10. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    I have vsync to 'Every V Blank' in the green checked setting
     
  11. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,988
    also your scripts had some code like
    QualitySettings.vSyncCount = res.refreshRate / 60;
     
  12. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    That was suggested to me to potentially solve the issue, it made it better but didnt fully fix it
     
  13. futurevlad2_unity

    futurevlad2_unity

    Joined:
    Nov 11, 2019
    Posts:
    8
    I tried downgrading a test project from 2020.2.0b9 to 2020.1.16f1 and it fully fixed it. I guess I'll have to wait for a new, out of beta version, since the bow project uses screen space ambient occlusion which is only in 2020.2.0b9. Would anyone have an ETA of the next version?
    Also thanks for helping me.