Language:
Page Info
Engine Version:

Redirectors

Choose your OS:

Moving or renaming an asset in UE4 leaves a Redirector in its old location. This is so that packages that are not currently loaded, but reference this asset, will know where to find it in its new location. Choosing a naming system early on and sticking with it will avoid many of the problems experienced with Redirectors.

Fixup Redirector From Editor

To see redirectors in the editor enable the Show Redirectors filter in the content browser. Then, right click a redirector and select Fixup. This will resave all packages that point to the redirector, and will delete the redirector if it was able to resave all things referencing it.

ResavePackages Commandlet

The ResavePackages commandlet can be run with the -FixupRedirectors option to try and fixup all redirectors in your project. Here's an example command line:

UE4Editor.exe <GameName or uproject> -run=ResavePackages -fixupredirects -autocheckout -projectonly -unattended

This version of the command line would be run by a user on their local machine. It will check out all files that need to be fixed up, and the user needs to submit them. -autocheckin can be used by an automated process and it will also check the files in for you.

Gotchas

Renaming

If you create an object, rename it, and then create a new object with the same name as the original, an error will occur. This is because a Redirector was created when the first object was renamed, and a Redirector and a resource cannot have the same name.

Dangling Redirector

There are a few known issues with Redirectors that can be reproduced as follows:

Scenario 1

  • Rename object A to B.

  • Delete B.

  • An error message will say that B could not be deleted because it is in use. This happens because the Redirector created during the rename will still point to B.

Scenario 2

  • Rename object A to B.

  • Rename object B back to A.

  • Delete A.

  • The redirector that was created for the first rename will be destroyed, but a new one will be created at B. As a result, A will not be able to be deleted because it is being referenced.

Fixing redirectors from the editor or SavePackages before deleting should solve these problems.