Foliage disappears when it has material that uses PerInstanceCustomData in packaged build

Hi, I ran into this issue on the Answerhub here: PerInstanceCustomData not working for HISM in standalone mode and packaged project - UE4 AnswerHub (
…and I wasn’t able to fix the issue by following the answer instructions.

You need to have the HISM component created in c++ (let’s say its called “HISM_Comp”). Then, after setting custom data value on all the required instances, you need to call BuildTreeIfOutdated function

I created a C++ component as a child of FoliageInstancedStaticMeshComponent, set NumCustomDataFloats = 1, then called BuildTreeIfOutdated in the constructor, but that stops it from even working in the editor.

What am I missing here? It’s so frustrating that it otherwise works fine but I can’t package it!


Here’s a video showing the issue: Unreal PerInstanceCustomData borked in production? - YouTube

And here’s a sample project - Google Drive