Changing name in CreateDefaultSubobject() stops object from creating its own Mesh

65 views Asked by At

I have a function in my code that creates a UStaticMeshComponent in the Actor’s constructor.

VisualMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));

And it’s works perfect. But as soon as I change name to something else, it stops working. The object stops creating its own Mesh. For example:

// NOT WORKING
VisualMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));

Can you tell me where I`m wrong?

Screenshot where name = L"Mesh": enter image description here

Screenshot where name = L"StaticMesh": enter image description here

0

There are 0 answers