Hello, I am subclassing UWheeledVehicleMovementComponent4W but I can not successfuly override this function:
UWheeledVehicleMovementComponent.h
virtual void SetupWheels(physx::PxVehicleWheelsSimData* PWheelsSimData);
Here is my code:
.h
void SetupWheels(physx::PxVehicleWheelsSimData* PWheelsSimData) override;
.cpp (#include “PhysXPublic.h”)
void UUnsealedWheeledVehicleMovComp4W::SetupWheels(PxVehicleWheelsSimData* PWheelsSimData)
{
if (!UpdatedPrimitive)
{
return;
}
ExecuteOnPxRigidDynamicReadWrite(UpdatedPrimitive->GetBodyInstance(), [&](PxRigidDynamic* PVehicleActor)
{
});
}
Build file:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PhysX", "APEX" });
PrivateDependencyModuleNames.AddRange(new string[] { });
Definitions.Add("WITH_PHYSX=1");
Error:
1>UnsealedWheeledVehicleMovComp4W.cpp.obj : error LNK2019: unresolved external symbol "class physx::PxScene * __cdecl GetPhysXSceneFromIndex(int)" (?GetPhysXSceneFromIndex@@YAPEAVPxScene@physx@@H@Z) referenced in function "public: static bool __cdecl FPhysXSupport<1>::ExecuteOnPxRigidDynamicReadWrite<class <lambda_fbc31c33d8fac28ca36dd3b4b0518bd6> >(struct FBodyInstance const *,class <lambda_fbc31c33d8fac28ca36dd3b4b0518bd6> const &)" (??$ExecuteOnPxRigidDynamicReadWrite@V<lambda_fbc31c33d8fac28ca36dd3b4b0518bd6>@@@?$FPhysXSupport@$00@@SA_NPEBUFBodyInstance@@AEBV<lambda_fbc31c33d8fac28ca36dd3b4b0518bd6>@@@Z)
I cleaned code and found out that this line is causing issue:
ExecuteOnPxRigidDynamicReadWrite(UpdatedPrimitive->GetBodyInstance(), [&](PxRigidDynamic* PVehicleActor)