Wrong HLOD layer assigned to HLODActors

Unreal Engine Version: 5.4.4

This post is related to bug report UE-229303.

I have the same issue, but the reason for it is not the “Include Actor in HLOD” flag - it’s the wrong HLOD layer is being assigned to the HLODActors, but you only get the Errors “…has an invalid HLOD layer…” when your HLOD layers are on a Grid other than the MainGrid (index 0).


Thats the setup of the 2nd Runtime Grid/Partition. 2 HLOD Layers: HLOD0 (Instancing) and HLOD1 (Approximated). Also notice the “Default HLOD Layer” name at the bottom - it will appear again in the error message shown below.

Thats how the HLOD Assets are set up:


After Building the HLODs, we get Errors like:

Actor /Game/Maps/PerformanceTest/PerfTest01.PerfTest01_HLOD_Approximated_Trees/PerfTest01_FoliageHLOD_0_-1_2_0_0 has an invalid HLOD layer /Game/Maps/PerformanceTest/PerfTest01_HLOD0_Instancing.PerfTest01_HLOD0_Instancing

Which makes sense, as these (1 example for each layer) HLOD actors got created:


In the last screenshot no HLOD Layer is assigned. That explains the error messages, as when an Actor is set to be Included in HLOD, but HLOD Layer Property is empty, it uses the “Default HLOD Layer” as fallback.

So the HLODActors on the Instanced Layer got HLOD Layer Approximated assigned (originally on the Mesh I had the Instanced layer assigned and also expected to be set for this HLODActor) and for the Approximated we have no HLOD layer assigned (expected the Approximated Layer gets set).

It somehow looks, as the “Parent Layer” Property is (mistakenly) used for the HLOD Layer properties of the HLOD actors instead of the assigned Layer.

Also: why are these Partition Layers get set, when setting “Is Spatiallly loaded” to false?

After looking into it some more, I think I’ve understood some things wrong. So the HLOD Layer Assignment for the Instancing actors seems to be correct - the only issue would be then, that on the Approximated Actors (where no HLOD Layer is assigned, as “Is Spatially loaded” is disabled) the flag “Include Actor in HLOD” is set. If that would be disabled, it would work fine, as it wouldn’t try then to add it to the default HLOD Layer. That seems to be the only issue then.

Update: as a workaround to avoid the errors, I just cleared the “Default HLOD Layer” slot. The final solution would be, to unset the “Include Actor in HLOD” flag on HLODActor generation for layers with no parent (“Is Spatially loaded” not set). A fix is needed in Engine code.

(post deleted by author)