Building with Unity 6 takes too long

I’m trying to build my project but it takes too long.
I was using 2019 LTS version with this project and it wasn’t taking this long, only takes few minutes.


It keeps compiling this vertex color shader but never even use this shader in my project.
I ended up canceling.

Here’s the shader settings, it’s not even in the list.
Idk, am I missing to disable some new feature?

Facing a similar issue, did you find a solution? Absurd build times, seemingly related to shaders. In Unity 6.1, with URP.
image

Took the following steps with no success:

In the end, the solution appears to be enabling as much shader stripping as possible in Project Settings > Graphics. I did:

  • Instancing Variants > Strip All
  • BatchRendererGroup Variants > Strip All
  • Enabled URP > Strip Runtime Debug Shaders
  • Enabled URP > Strip Post Processing Variants
  • Enabled URP > Strip Unused Variants

I imagine one of those (my money’s on the last one) was causing trouble.

Got it down to 14 mins, which still isn’t great (pretty sure that’s longer than my pre-Unity 6 build time), but it’s manageable now.

It has been 6 months. I don’t remember what did I do after this post. I look up in my github commits but couldn’t find anything.

I just tried again building as a test and it take 14 minutes. Then I did another and that taked 8 seconds. Obviously it’s because I select same folder and it only export files that are changed. So if you can use same folder.

One thing I did change is the Instancing Variants to Strip Unused. But Idk it’ll help since you already tried Strip all. I also remember trying some of the stuff you said.

I don’t know how to help. So here’s build and player settings I use. Maybe there’s something I missed.

Few things I want to mention. My project is using built-in render pipeline (don’t ask), and can work with Shader Graph somehow in Unity 6. But If I make a lit Shader with SG and try to build, it takes soo long to build. It’s because lit shaders from SG in build-in has 4.17k variants. An unlit SG has 23 variants and my custom HLSL Shaders has around 350 variant each. More variant shader = more build time.

When I upgrade to Unity 6, Pro builder made bunch of Shader Graph materials, I remember deleting them.
However, my project is not URP or HDRP. Maybe this problem is exclusive to Build-in render pipeline.

Here’s how you can check variant count:


If I uncheck skip unused shader_features it becomes 68.9 M variants.

God you saved my life!!
For me it took forever to build since I changed one of my project to Unity 6.0.
Never have experienced this kind of situation when I was using 2022 or 2023..
But Following your setting(Stripping all), made my build time just like 2023. Took only like 6 minutes or so. None of my assets on the scene are affected by changing thos setting either.
Thank you so much!

i have a similar problem too

Same here! Nothing has changed! New Unity 6 - new problems!

3 Shaders plus the internal Unity shaders = 4 hours compile time on Unity 6.4!

Bravo!! *clap clap


I have a simple third person platformer with multiplayer and it’s been building for over 2 hours?? Why in the world is it taking this long to build? It shouldn’t be taking more than 10 minutes let alone 2 HOURS???

I had an almost identical problem when I created a single reflection probe in the scene, which caused all the shaders to increase their number of variations to millions, and the build size doubled. Since this feature wasn’t central to the game, I had to resort to my own computational workarounds, because the mere presence of probes and other factors that can affect lit shaders automatically increases their weight by adding a potentially large amount of functionality and variations.:sob:

I’m having huge build time issues as well. Managed to update our game from 2021.3 to 6.5 with everything working properly, but the build times went from 10-15 minutes to 2,5 hours. Trying now to strip all possible shaders, but it’s a 2D game, so not many shaders should be in use anyway… Also according to the loading bar a lot of the time the editor is just “Build Player” stage, and not even compiling shader variants.

This is a very odd problem to have. Haven’t completed my troubleshooting where the big change is, but at least as far back as 6.2 had these same problems.

Do you have any shaders in Always included shaders in Graphics settings?

Only the ones that are there by default.

There should be none there by default. Try deleting them from that list, it will probably make your build times way better.

Might be a relic from 2021.

The URP sample definitely has a list of always included shaders. I know the cube shaders for example are used for reflection probes and in the past were tripped out while they should be kept. if that issue has been solved, please update the URP template.

Off topic but why does the “Always Include Shaders” tab even exist? Like what does it do other than making the build process slow then? It includes the shaders that are not on the list in the build anyway.

One example is when you load a model from disk or API during runtime, and need to apply a shader that is not used elsewhere

This is the new URP project template in Unity Hub? Or some other sample you’re talking about?

Yes, the Universal 3D template from the hub

Those shaders are pretty lightweight and do not have many variants, so there’s little influence from those on the build times.
Most of the excess build time often comes from URP configuration.

I’m pretty sure everything Canvas-related just breaks if you remove UI/Default. That has been my experience in the past.

Also pretty sure CubeBlur, CubeCopy and CubeBlend is put in there automatically by something in URP, and is required for some LOD stuff?