Download

Set Visibility is not working on UDestructibleComponent

Hi,

I have a C++ class derived from AActor. Inside I have a UDestructibleComponent.

In the constructor I want to disable/hide this component to avoid it will be destroyed when damage is applied until I want.

Here is my constructor code…




CmpRoot = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
RootComponent = CmpRoot;

DestructibleMesh = CreateDefaultSubobject<UDestructibleComponent>(TEXT("DestructibleMesh"));
DestructibleMesh->AttachParent = CmpRoot;		
DestructibleMesh->SetVisibility(false);



I have tried also with DestructibleMesh->SetHiddenInGame(true) without success.

Any idea??

Thanks!