# Lightmass crash: "Static mesh element count did not match mesh instance count!"

**URL:** <https://forums.unrealengine.com/t/lightmass-crash-static-mesh-element-count-did-not-match-mesh-instance-count/438805>\
**Category:** Rendering\
**Tags:** Lightmass, building-lighting, lightmass-crash, unreal-engine, Lighting, UE4, question\
**Created:** [December 4, 2018, 12:26am UTC](https://forums.unrealengine.com/t/lightmass-crash-static-mesh-element-count-did-not-match-mesh-instance-count/438805 "2018-12-04T00:26:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brittnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brittnell](https://forums.unrealengine.com/u/brittnell)\
**Post date:** [December 4, 2018, 12:26am UTC](https://forums.unrealengine.com/t/lightmass-crash-static-mesh-element-count-did-not-match-mesh-instance-count/438805/1 "2018-12-04T00:26:30Z")

</div>

This error seems to have popped up out of nowhere (was running fine, then suddenly not) when attempting to build my lighting.

**=== Lightmass crashed ===  
Assertion failed: StaticMesh-\>GetLOD(GetMeshLODIndex()).NumElements == MaterialElements.Num() [File:D:\Build++UE4\Sync\Engine\Source\Programs\UnrealLightmass\Private\Lighting\StaticMesh.cpp] [Line: 277]  
Static mesh element count did not match mesh instance count!**

Running a geometry build doesn’t reveal any errors.

I can’t seem to figure out what the heck is causing it… any ideas on what it’s talking about, and how I might go about fixing it?

Thanks!

 ![261237-lightmasscrash120318.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/3/d738cc651b080c748955274935497dfdc4f687a1.jpeg)

---

<div class="post-metadata">

**Author:** ![brittnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brittnell](https://forums.unrealengine.com/u/brittnell)\
**Post date:** [December 4, 2018, 1:57am UTC](https://forums.unrealengine.com/t/lightmass-crash-static-mesh-element-count-did-not-match-mesh-instance-count/438805/2 "2018-12-04T01:57:00Z")

</div>

Solution was found [here](https://answers.unrealengine.com/questions/747087/lightmass-crashed-assertion-failed-and-more.html), under a different but similar error.

---

<div class="post-metadata">

**Author:** ![Federico\_Vignone](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Federico\_Vignone](https://forums.unrealengine.com/u/Federico_Vignone)\
**Post date:** [June 28, 2020, 2:50am UTC](https://forums.unrealengine.com/t/lightmass-crash-static-mesh-element-count-did-not-match-mesh-instance-count/438805/3 "2020-06-28T02:50:28Z")

</div>

Hello Brittnell! I have the same problem, but it is not solved with the Swarm Agent! What can be? Thank you!

 ![305614-sin-titulo.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/2/af2cbcf1c0f3457ca9c47d601af93f2e23073695.png)

---

<div class="post-metadata">

**Author:** ![NMP\_Mr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NMP\_Mr](https://forums.unrealengine.com/u/NMP_Mr)\
**Post date:** [September 5, 2022, 8:21pm UTC](https://forums.unrealengine.com/t/lightmass-crash-static-mesh-element-count-did-not-match-mesh-instance-count/438805/4 "2022-09-05T20:21:48Z")

</div>

In case anyone has this issue and cant find an answer like I could not, to the “Static mesh element count did not match mesh instance count!” I figured out a solution. Hopefully this helps someone.

I accidentally auto generated an LOD so low, that it had 0 triangles, must have moved a decimal point. Anyway, once I re-did that LOD so it had some triangles, it worked perfectly.
