If you already had “CodingTest.h” included in your .cpp then that was the “{MyGame}.h” file; I don’t mean to literally add “{MyGame}.h”, I’m using {MyGame} as a placeholder for whatever your game project is called.
Try deleting the “.vs”, “Binaries”, and “Intermediate” directories within your project folder (make sure Visual Studio isn’t open); and then regenerate the project files (Right-Click on your .uproject file, and select “Generate Visual Studio Project Files”.
When that’s done, open your project in Visual Studio, allow it to scan your project, and then when it’s ready try the build again.
It looks like Visual Studio isn’t finding the Pickup.h file, if forcing the project re-scan doesn’t help, can you post the directory structure that leads to your Pickup.h and Pickup.cpp files?
i.e.
“Project Directory/Source/Actors/Pickup.h”
“Project Directory/Source/Actors/Private/Pickup.cpp”
As a long shot, you could also try adding a call to the AActor constructor:
APickup::APickup()
:
AActor()
{
PrimaryActorTick.bCanEverTick = true;
}
If you get errors from your build, please post the content of the Output tab so we can get a better idea of what’s going on.