CreateDefaultSubobject Name: None

If I start the engine I get a strange error

Fatal error: [File:D:\Build++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3537] Illegal default subobject name: None

UE4Editor_Metro2_6630!AEscalator::AEscalator() [d:\epic games\unreal projects\metro2\source\metro2\escalator.cpp:63]

Line 63 says (in a for loop)
MeshStairComponents.Add(CreateDefaultSubobject(*FString(“MeshStair” + i)));

So obviously the Name is not None, what am I doing wrong? :slight_smile:

try TEXT(“MeshStair”)

also im kinda suprised it doesnt complaint about the char* + int (unless i isnt an int?)

I still don’t know, what caused the problem, but now I rewrote the code usind NewObject into OnConstruction(), so I don’t need a name :smiley: Is it fine to use the same name for multiple objects, because Im creating multiple meshes in a for loop?

Commenting if anyone wonders about this:
It doesn’t complain because char* + int only offsets the char pointer, so “MeshStair” + 1 = “eshStair”, “MeshStair” + 4 = “Stair” etc. If your i reaches the amount of characters in “MeshStair”(9) you will end up with an empty string. If your i reaches beyond that you will get random data in your string.