I’ve already added a class that extends from SpringArmComponent, and it all works fine, Now I’m trying to completely replace that class with my own to get rid of some now-redundant properties from the editor.
However, when I add a class extending from SceneComponent through the editor and try compiling in Visual Studio, I get an error. I haven’t modified the new class at all yet.
The error:
error C2653: 'UCameraBoom' : is not a class or namespace name <Project Path>\Intermediate\Build\Win64\Inc\ThirdPersonTest\ThirdPersonTest.generated.inl 11 1 ThirdPersonTest
There are a ton of other error messages all along the same lines (“identifier not found”, “undeclared identifier” etc) all from ThirdPersonTest.generated.inl.
The only occurrence of ThirdPersonTest.generated.inl" I can find is in ThirdPersonTest.cpp, which doesn’t have any includes for the other class I created.
ThirdPersonTest is the name of the project, yes.
That seems to have fixed it. I had a look at the ThirdPersonTest.generated.inl file before and after re-adding the new class, and it seems to be removing all of the includes from the file except the one for the first new class I created. Not sure if this is a bug or not.
It sounds like the generated file for it has created some UObject code for UCameraBoom which requires the header be included for it to compile.
I’m not exactly sure what it generates, but I had similar issues when porting our samples over to use Slate widget style classes. The solution was to include my new UObject classes before the Module.inl file, inside the Module.cpp file.