Skip to content

Instantly share code, notes, and snippets.

@nebulou5
Created June 16, 2018 22:03
Show Gist options
  • Save nebulou5/a6248ddf5c6c28a5f0272f00258a6d9d to your computer and use it in GitHub Desktop.
Save nebulou5/a6248ddf5c6c28a5f0272f00258a6d9d to your computer and use it in GitHub Desktop.
static ConstructorHelpers::FObjectFinder<UMaterial> MaterialFinder(*SelectionMaterialPath);
if (MaterialFinder.Succeeded()) {
SelectionDecalMaterial = MaterialFinder.Object;
SelectionDecalMaterialInstance = UMaterialInstanceDynamic::Create(SelectionDecalMaterial, this);
SelectionDecal = CreateDefaultSubobject<UDecalComponent>(TEXT("SelectionDecal"));
SelectionDecal->AttachTo(RootComponent);
SelectionDecal->SetDecalMaterial(SelectionDecalMaterialInstance);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment