"Move to folder" bug fix?

I noticed this problem likely only happen to older ue version project file, like ue template or starter content.

However, this also happen on new ue version project, but likely only on blueprint.
I noticed, when I moved a file referenced by a blueprint, the blueprint file will require compile but not marked as changed.

What you need to do is:

  1. Resave all files (to make sure they are updated to the current ue version). For blueprint file, I recommend to recompile too.
  2. Move the files.
  3. Fix redirectors
  4. Recompile blueprints and resave again.

To resave and recompile, you need to make a small changes to the file, which could take a while and difficulty to do on large project.

An alternative way to do it is call Modify() function and set blueprint Status to BS_Dirty.
I think, this can be only done by C++, but you can create it as blueprint function and use Blutility to call the function.
Here is my code.

void UBPFunctions::SetAssetDirty(UObject* Target)
{
	if (!Target)
		return;

	Target->Modify();

	UBlueprint* TempTarget = Cast<UBlueprint>(Target);

	if (TempTarget)
	{
		TempTarget->Status = BS_Dirty;
	}
}

After the blueprint is marked as dirty, you can play the game to force them to compile then save.
I have been doing this for a while, so far so good, no more broken reference.

Btw, you need to recompile and resave the file you moved and files referenced to it.
For example:


You moved the red file, then recompile and resave red and blue files