How to delete a component once created

How to delete the PositionReport component. I have tried deleting it from all the objects like SM_Chair , SM_Rock, the class files in VisualStudio and the file-system. But when I tried to create the PositionReport component again, UE4 editor says “the name PositionReport is already used by another class”. So there should be a clean way to delete the user defined components.

1 Like

First, to avoid problems, make sure the component is not being used anywhere in the game, and close the Unreal Editor.

Then, delete the source and header files directly from the file system and from Visual Studio’s project (you can also delete only from the file system and ask Unreal to regenerate the Visual Studio project).

Finally, recompile your C++ code. Unreal Editor must already be closed at this time. When you reopen it, you should be able to recreate a component with the same name.

The issue is that Unreal uses a “hot reload” mechanism to allow you to recompile C++ code without having to quit and reopen the Editor. However, this mechanism does not completely clean up classes that were deleted. In order for this clean up to take place properly, you need to compile the C++ code while Unreal Editor is closed, so that it can do a clean build instead of a hot reload build.

2 Likes

Privacy & Terms