I double-checked and CoreUObject is there.
Might be a st00pid take from me, but isn’t this happening because
GetPrivateStaticClass
is a private method ?
I had thought the same but then why would the HeterogeneousVolumeComponent have it as private or not work compared to other components? Unless it’s just a minor bug that I have managed to stumble across
Here’s the non-constructor code - I was going to add the component to an array but I often just build as I go along and found that even this wouldn’t work. The constructor - CreateDefaultSubobject attempt I tried was even simpler, just creating the object.
“this” also refers to a component that inherits USceneComponent so I don’t know if that’s an issue (or even bad practice tbh)
for(int i = 0; i < ProjectileCount; i++)
{
if(UHeterogeneousVolumeComponent* VolumeComp = NewObject<UHeterogeneousVolumeComponent>(this, *FString::Printf(TEXT("Volume Component %d"), i)); VolumeComp)
{
VolumeComp->SetMaterial(0, VolumeMaterial);
}
}