I did the following:
ADodgeballProjectile::ADodgeballProjectile()
{
PrimaryActorTick.bCanEverTick = true;
SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("Sphere Component"));
// others have been removed for the sake of simplicity!
SetRootComponent(SphereComponent);
UPhysicalMaterial* PhysicalMaterial = CreateDefaultSubobject<UPhysicalMaterial>(TEXT("Physical Material"));
PhysicalMaterial->Friction = 0.1f;
PhysicalMaterial->Restitution = 0.5f;
SphereComponent->BodyInstance.SetPhysMaterialOverride(PhysicalMaterial);
}
and I got 3 errors as follows:
Error LNK2019 unresolved external symbol "__declspec(dllimport) private: static class UClass * __cdecl UPhysicalMaterial::GetPrivateStaticClass(void)" (__imp_?GetPrivateStaticClass@UPhysicalMaterial@@CAPEAVUClass@@XZ) referenced in function "public: __cdecl ADodgeballProjectile::ADodgeballProjectile(void)" (??0ADodgeballProjectile@@QEAA@XZ) Dodgeball C:\Users\amd\Documents\Unreal Projects\Books\Dodgeball\Intermediate\ProjectFiles\DodgeballProjectile.cpp.obj 1
Error LNK1120 1 unresolved externals Dodgeball C:\Users\amd\Documents\Unreal Projects\Books\Dodgeball\Binaries\Win64\UE4Editor-Dodgeball-0019.dll 1
Error MSB3073 The command ""C:\Program Files\Epic Games\UE_4.27\Engine\Build\BatchFiles\Build.bat" DodgeballEditor Win64 Development -Project="C:\Users\amd\Documents\Unreal Projects\Books\Dodgeball\Dodgeball.uproject" -WaitMutex -FromMsBuild" exited with code 6. Dodgeball C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44