Ah, it looks like you are using 5.2. I haven’t installed that version, so I wasn’t able to build your solution.
I did take a look at the code though, and I think the way you are fetching the material is a bit odd, and I wonder if that might be the issue.
I would create a class derived from Developer Settings and assign the material in that. Then you could use that to retrieve the material.
Example:
#pragma once
#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "MyDeveloperSettings.generated.h"
class UMaterialInterface;
UCLASS(Config = Game, defaultconfig, meta = (DisplayName = "My Developer Settings"))
class WHATEVER_API UMyDeveloperSettings : public UDeveloperSettings
{
GENERATED_BODY()
public:
UMyDeveloperSettings();
UPROPERTY(Config, EditDefaultsOnly)
TSoftObjectPtr<UMaterialInterface> defaultTileMaterial;
};
Then, in your code, you can grab the material from the CDO:
CurrentBatch->Material = GetDefault<UMyDeveloperSettings>()->defaultTileMaterial.LoadSynchronous();
I haven’t tested this code, but it should work.