Failing to Add a new subclass correctly

Hi guys! So I am trying to create a child class of BasePawn, as the tutorial ask us to do. When I do so, I get errors on the .h file. I go to UE5 to tools/rebuild visual studio project and now this time the errors are gone, but instead my .cpp file does not recognise any properties I make in the .h file. For the constructor it says I have no member and for the components that they are undefined.

Help please?

Well I found a solution… however it was pure clicking things till stuff worked, so maybe a more experienced person could translate what I did, but anyway, here is what i did:

Deleted my binaries folders, then tried opening the project, accepted the prompt to rebuild the files, then I refreshed the visual studio project inside UE (tools/refresh visual st…), then closed UE, right clicked on the uproject and selected Generate Visual studio project files.
Now I had a compiling error where it said that ToonTanks.dll didn’t have live code enabled (eventhough I did have the checkbox checked in the project settings). I went to editor preferences/live coding and disabled live coding. Compiled, enabled live coding, compiled again and then no more squiggly lines and everything worked again.

My guess is that I shouldn´t have erased the binaries folder in the first place and that just refreshing the visual studio projects would have done the job but I don´t know that really xD

For IntelliSemse errors, you need to do Tools > Refresh VS Code Project within Unreal whenever new files are created.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms