I’ve created a fresh project and created my class with exact same names as yours so I don’t get confused.
Here is my new WheeledVehiclePawnEx, I’ve added the include for the component in both .h and .cpp :
#pragma once
#include "CoreMinimal.h"
#include "WheeledVehiclePawn.h"
#include "WheeledVehicleMovementCompEX.h"
#include "WheeledVehiclePawnEx.generated.h"
/**
*
*/
UCLASS()
class MOB_API AWheeledVehiclePawnEx : public AWheeledVehiclePawn
{
GENERATED_BODY()
public:
AWheeledVehiclePawnEx(const FObjectInitializer& ObjectInitializer);
};
#include "WheeledVehiclePawnEx.h"
#include "WheeledVehicleMovementCompEX.h"
AWheeledVehiclePawnEx::AWheeledVehiclePawnEx(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<UWheeledVehicleMovementCompEX>(VehicleMovementComponentName))
{}
Then I created the WheeledVehicleMovementCompEX (from ChaosWheeledVehicleMovementComponent, right?)
#pragma once
#include "CoreMinimal.h"
#include "ChaosWheeledVehicleMovementComponent.h"
#include "WheeledVehicleMovementCompEX.generated.h"
/**
*
*/
UCLASS()
class MOB_API UWheeledVehicleMovementCompEX : public UChaosWheeledVehicleMovementComponent
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
void SetCOM(FVector newValue, bool bOverride);
UFUNCTION(BlueprintCallable)
FVector GetCOM();
};
and
#include "WheeledVehicleMovementCompEX.h"
void UWheeledVehicleMovementCompEX::SetCOM(FVector newValue, bool bOverride)
{
bEnableCenterOfMassOverride = bOverride;
CenterOfMassOverride = newValue;
if (UpdatedPrimitive && UpdatedPrimitive->GetBodyInstance())
{
UpdateMassProperties(UpdatedPrimitive->GetBodyInstance());
}
SetupVehicleMass();
}
FVector UWheeledVehicleMovementCompEX::GetCOM()
{
FVector COM = FVector::Zero();
if (bEnableCenterOfMassOverride == true)
{
COM = CenterOfMassOverride;
}
else {
if (UpdatedPrimitive && UpdatedPrimitive->GetBodyInstance())
{
COM = UpdatedPrimitive->GetBodyInstance()->COMNudge;
}
}
return COM;
}
From this point I get no error in visual, live coding succeed as well.
Then I create a BP based on the vehicle pawn. The component is already initialized to my custom one :
I can now find the function but can’t connect to the component nor the cast (had to uncheck “context sensitive” to find it) :
I understand I can’t connect incompatible objects, but I don’t understand why the component isn’t the class specified in the detail pannel. I can’t swap to the original component either, it doesn’t appear in the dropdown (I guess it is due to initialization in c++?).
I also noticed in your dropdown you have a BP version of the component :

I’ve tried to create one but I can’t. I tried also to create an actor component to reparent but that is not possible either :
Actor component :
I’m probably missing something obvious. I apologize if it seems a bit nooby, and once again I thank you for your patience
Edit : Nevermind, I think I’m holding something :