Great Information :) FNames are very useful for keys Data tables make use of FName as their Key value which as stated being hashed makes it much faster to find the rows you are looking for. I use FName a fair bit but i do not use it for everything, for example conversion from FString to FName will lose Character Case as FNames are case insensitive so not great for display text Also if memory serves the problem with FName is it isn't garbage collected so if someone is playing your game for hours and you create a lot of FNames this could flood you games memory Additional notes for C++: FName in C++ has 32 constructor overrides for passing in various text types, from FString to Widechar's etc, and in reverse it has a very easy ToString() function to get back an FString if you need it, it also has a compare function and various sanitizing functions to clean up the text e.g. sanatizeWhitespace Hope the additional information helps you decide when to use FString vs FName, also dont forget about FText ;)
4 weeks ago | 2
Taken Grace
Why would you use a "Name" Variable instead of a "String" Variable?
Performance Benefits:
Names are hashed - Stored as hash values internally, making comparisons much faster
Memory efficient - Multiple references to the same name share the same memory
Optimized for lookups - Perfect for inventory searches and filtering
Unreal Engine Integration:
Better Blueprint integration - Names work seamlessly with Blueprint systems
Asset referencing - Names are the standard for referencing assets and objects
Debugging friendly - Names show up clearly in debugger and logs
Localization ready - Can be easily converted to localized text when needed
4 weeks ago | [YT] | 21