Download

make decal component invisible is not working

Hey. I have a decal component:


UPROPERTY(EditAnywhere, Category = "Decal")
		UDecalComponent* selectionDecal;


selectionDecal = ObjectInitializer.CreateDefaultSubobject<UDecalComponent>(this, TEXT("DecalComponent"));
	selectionDecal->AttachTo(RootComponent);

I want to change its visibility so on beginPlay I have tried to do:


void AViking::BeginPlay()
{
	Super::BeginPlay();

	selectionDecal->bVisible = false;
}

When I run the game something weird happens. I can see the decal like the bVisible = false; did not changed anything. BUT when I press Eject and press on the object selectionDecal’s visibility goes off:

Before the Eject and pressing the object:

After the Eject and pressing the object (do not notice the sphere):
Action Mapping.png

Is that a bug? or can I fix it somehow?

UP…

Problem solved.
All I needed to do I write:
selectionDecal->SetHiddenInGame(false);