4.9.2 Deleted actor still available to select in iheritance window

Hello,

repro steps:

  1. Create new blank c++ project

  2. Go to Add New → C++ Class and create new class inherited from Actor. Name it MyActor.

  3. Open VS and add this code in MyActor::Tick() function:

    if (GEngine)
    GEngine->AddOnScreenDebugMessage(-1, 1.f, FColor::Red, “Tick from my actor”);

  4. Add #include “Engine.h” in MyActor.cpp

  5. Compile from Editor

  6. After hot reload create new blueprint, inherit it from “MyActor”. Name it BP_MyActor. Put an instance of this blueprint into the world.

  7. Hit pie. You will notice message “tick form my actor” message gets printed. close PIE

  8. Save all (Ctrl + s). Remove instance of BP_MYActor from world. Remove BP_MyActor from content browser. Save all

  9. Go to vs. In solution explorer remove MyActor.h and MyActor.cpp from solution. (rightclick and “Delete”)

  10. Go to project source directory. Remove files MyActor.h and MyActor.cpp.

  11. Go to Editor. Hit compile button. Compilation is successfull

  12. Create new blueprint, try to inhrit it from MyActor. You shouldn’t be able to do that but You can. Error.

  13. You can even put instance of created blueprint into the world and see that “tick from my actor” message still gets printed. MyActor class still exists withing UnrealEditor even after removing it and sucsessfull recompilation.

thanks

Hey-

The references to the class have not been fully removed from the project. After step 10 you need to also right click on the .uproject file and select “Generate Visual Studio project files”. This will refresh and update all of the project files and communicate that the class removed is no longer part of the project.

Cheers

Hello Dough,

according to Your advice I’ve made those steps:

(Steps 1 - 10 as in original post)

  1. Close Visual Studio

  2. Go to project directory, left click on project icon, hit “Generate Visual Studio project files”

  3. Open vs project. Verify that “MyActor.h” and “MyActor.cpp” are not on the list of project files in solution explorer.

  4. Go to editor. Hit compile button. Compilation is successfull but class is still visible in iheritance window. Error

  5. Trying to recompile in VS by hitting BUILD->Rebuild Solution (maybe this will properly delete class). Recompiling in visual studio fails with this errors:
    68951-
    thanks

Hey-

After testing again I have entered a bug report about the deleted class still showing in the list of blueprintable classes in the editor (UE-24045).

Cheers

Hi,

in step 15 (after adding class, then deleting it, then refreshing VS project) are You also getting this strange compilation error?

thanks

I did not get any compile error after removing the class and refreshing VS.