UStaticMeshComponent->SetPhysMaterialOverride crash

alkohol
Mon, 18 Jan 2016 12:58:47 +0000
World Creation

I took Puzzle basic template for c++ project. There I add in Block class pointer to phys material:

UPROPERTY()
class UPhysicalMaterial* PhysMaterial;

And for now I initialize material through ConstructorHelpers and SetPhysMaterialOverride on UStaticMeshComponent with this material like this:

struct FConstructorStatics
    {
    	ConstructorHelpers::FObjectFinderOptional<UPhysicalMaterial> PhysMaterial;
    	FConstructorStatics()
    		: PhysMaterial(TEXT("/Game/StonePhysicalMaterial"))
    	{
    	}
    };

BlockMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("BlockMesh0"));
...
BlockMesh->SetPhysMaterialOverride(PhysMaterial);

So when I play project in editor all works fine. But If I’m trying to launch project as a game, or just play standalone game through editor then application is crashed and report points to this line:

BlockMesh->SetPhysMaterialOverride(PhysMaterial);

After that If I restart editor it’ll be not running with the same crash report. I sent report, my machine ID is 7B9A5253489C7324713D93A95783DC83

7 posts - 1 participant