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?

1 Like

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.

1 Like

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!

1 Like