Is it safe to use OverrideNativeName specifier?

Hi, I noticed an undocumented metadata specifier that can be added to uproperties and ufunctions: OverrideNativeName.
It seems to me that it is currently only used during the Blueprint nativization process, in order to override the generated name for variables and functions.
I was thinking to use it in our c++ classes to override property names that are exposed to Blueprint.
My only doubt is that, being an undocumented specifier, it is unsafe to use (as its behaviour might change in the future).
Does anyone know anything about it?

Hey,

I know this is an old AnswerHub question. But I thought I would throw my two cents in if someone else arrives here.
I’m not sure exactly the use case of OverrideNativeName but for what you want to do:

I was thinking to use it in our c++ classes to override property names that are exposed to Blueprint.

… you should probably be using the DisplayName metadata specifier. It is documented here and seemingly does what you want.

I’ve seen OverrideNativeName used on my current project as a way to change exec c++ functions names to something else. I’m guessing the reflection system essentially exchanges the stored function name with the metaspecifier value.

So if you create a function CheatCode like below, you can type in SomeOtherName in the console instead of CheatCode. This would allow you to use special character inside in the console like dots like so: Category.Cheat.

UPROPERTY(exec, meta = (OverrideNativeName="SomeOtherName"))
void CheatCode()
{
    // some cheat code
}
1 Like