Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Unity Super Slow

Discussion in 'Editor & General Support' started by Rachan, Apr 11, 2024.

  1. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    792
    Hi there!

    I using Unity 2022.3.21f1 with Unity Plus Plan
    and I working on my super big project, about 15-20GB of project size
    my game named "Santhai" and it was released on iOS, Android, and PC Steam

    Now, I still working on this huge project for Update and bug fixes, But why it start so slowly?
    When I customize my C# scripts and save to trying on editor, But it take about 3-5 Min to continue Playing
    I don't even use Plastic SCM to upload my changed to the server, because I'm afraid that it might have to compiling my code and my changed every time, and it may start very very slow,

    anyone have any tips about this?, how to increase work speed?

    Thanks!!!
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    For a lot of script using Assembly Definitions is great to get back responsiveness. If your code is not set up the best it will be quite a task. Without this all C# scripts recompile every change iirc


    And you can check the editor profiler as well to see if it is just compilation or also other things.
     
    Rachan likes this.
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,422
    I should make templates like Kurt Dekker. ;)

    Like, is Unity super slow when you create a new, empty project? Of course it isn't. Everything that makes Unity slow is in your project. So you got to profile it. Profiler in edit mode with deep profiling, make a script change, analyze.

    Did you write any editor scripts or imported assets that provide editor scripts? Scrutinize them specifically because more often than not those do too many things very inefficiently.

    Make sure you remove unused assets, packages and modules. Keep your assets in the format you use them, ie don't import 8k textures when you only output 2k, and prefer PNG over PSD, or FBX over blend.

    In addition your system specs and config can play a large role. Is your project on a spinning magnetic disk drive of the ancient past, or on a SSD? Do you have the project excluded from virus scanners or do you happily allow several virus scanners run their analysis of every change to a .meta file?

    In any case: Source control does not cause scripts to recompile.

    To speed up enter playmode, see this: https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html
    But it may be too late to enable this now as you'll likely run into "static" issues. But for the next project ...
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,488
  5. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    792
    thank you guys very much for the advices!
    or it slower because of internet speed?

    because, today my internet speed is drop down from 20mbps to 0.01 mbps?

    I'm not sure, it possible to turn-off background connection?
     
  6. mihaipopescu

    mihaipopescu

    Unity Technologies

    Joined:
    Nov 24, 2015
    Posts:
    7
    As was said before. We can be here all day and speculate. Instead take some time, profile your game and optimize. Otherwise you're just shooting in the dark.
     
    Rachan likes this.
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,008
    "Akshually..." that's a bit overbroad of a statement. :)

    Yes, source control simply observing a directory should never trigger a script recompile / reimport.

    And... source control being commanded to change the contents of your project SHOULD under all circumstances trigger a recompile / reimport.

    I will also note that one way to get in trouble with Unity is to do a "heavy" source control branch change (eg, change points in your timeline in a way that causes a large number of files to be modified), then alt-tab back to Unity before all the changes get written to disk.

    My theory on that last one is that Unity sees some changes and then starts furiously recompiling / reimporting, only to have additional changes written to disk by the now-in-background source control, and then the asset database gets out of sync with the file hashes, or some other similar bookkeeping error crops up.
     
    Rachan likes this.