[New feature from 4.25 crash] SetCustomDataValue on UFoliageInstancedStaticMeshComponent

Hi, I’m trying to use the new functionality added in 4.25 - SetCustomDataValue(…) which allows to pass custom data to individual instanced mesh instances.
However I cannot make it work on UFoliageInstancedStaticMeshComponent. Game crashes as soon as I invoke SetCustomDataValue method ( with Array index out of bounds exception ).
I suspect that I should somehow set NumCustomDataFloats variable, but I don’t know how to do it or is it event possible for foliage instanced sm component.

Any help would be highly appreciated.

Hey! I just solved this problem for myself, could be very similar to your issue.

I added:

newHISM->NumCustomDataFloats = 1;

BEFORE registering the component.

Then I used:

HISM->SetCustomDataValue(instanceID, dataID, float, markDirty);

Hope that helps.