FName LEV_Mode = "_PLAY_";
int32 LEV_Current = 10;
FName LevelJump = "LEV_" + LEV_Current; // OK
FName LevelJump = "LEV" + LEV_Mode + LEV_Current // ERROR!
UGameplayStatics::OpenLevel(GetWorld(), LevelJump);
How to join 2 FNames without converting it all into strings?
Natalo77
(Natalo77)
January 13, 2022, 9:48am
2
I know what each type does in principle, however, the variables tutorial skips any explanation of Name and Text variables in context of each. I have seen this but it is isn’t that contextual. Is there some general rule-of-thumb that can be applied...
Reading time: 2 mins 🕑
Likes: 10 ❤
This post should help you
The only workaround for joining FNames was to convert to a FString, do my concatenations, then convert back again.
Dumb. Me or FName?
eblade
(eblade)
January 14, 2022, 6:38pm
4
In general, FNames are usually something you aren’t stringing together dynamically. What a re you using this dynamically built FName for?
just to get names dynamically of level to load
LEV_001, LEV_002, LEV_003 …
The built in UE static uses an FName for the level reference…so I built my concatenate function using FNames…well bad idea!
1 Like
Natalo77
(Natalo77)
January 17, 2022, 8:14am
6
I don’t think you want to be using or operating on FNames until you absolutely need them.