Renaming C++ Classes in Unreal Engine

Renaming C++ Classes in Unreal Engine

If you rename c++ classes and files, they are not found in non-code assets in your game. To avoid this one can use “Core Redirects”. These are simply lookup values that match the old name of the class (used in your assets) to the new name (that you changed it to).

These redirects need to be entered into the “DefaultEngine.ini” file for projects or into the “MyPlugin/Config/DefaultMyPlugin.ini” file for plugins. Note that “MyPlugin” is the name of the plugin and that the config folder may need to be created as it is not created automatically.

Now, in that file, under [CoreRedirects] add the following line per class.

[CoreRedirects]
+ClassRedirects=(OldName="OldClassName",NewName="NewClassName")

Note that the class names are without the class prefixes such as U for objects, A for actors and so on.

The redirect feature can do way more than that. It can also be used for variables, enums, functions, properties etc.

Unreal Engine Core Redirects Documentation

https://docs.unrealengine.com/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Assets/CoreRedirects/index.html


Comments

Popular posts from this blog

Blueprint functions without exec pins in Unreal Engine

Setting Build Platforms for plugins in Unreal Engine