ive been struggling with a bug where defaults and meshes etc. are getting reset in child blueprints. this has been a well known bug since much earlier versions of the engine. I decided to workaround this by setting things like this in the constructors in C++.
Just like in the blueprints its works for a while. And then after i close the editor and open it up the filepath and code that was previously working fine now results in a nullptr and throws an exception.
//constructor in question
UTankTrack::UTankTrack()
{
PrimaryComponentTick.bCanEverTick = false;
SetTrackMesh();
SetNotifyRigidBodyCollision(true);
SetLinearDamping(0.5f);
SetAngularDamping(0.8f);
//Works only once, fails the next time
static ConstructorHelpers::FObjectFinder<UPhysicalMaterial> Material(TEXT("PhysicalMaterial'/Game/Tank/Track.Track'"));
SetPhysMaterialOverride(Material.Object);
}