I’m trying to modify a few functions of the ChaosWheeledVehicleMovementComponent, I have created a new empty cpp class inheriting from UChaosWheeledVehicleMovementComponent, but when I assign it to my vehicle, it stops working and starts freaking out and the car jumps around the map.
Any idea of why it’s doing that?
I haven’t added any custom code yet, just created the class, shouldn’t my car just behave as it would with the original component?
Header of the new class:
#pragma once
#include "CoreMinimal.h"
#include "ChaosWheeledVehicleMovementComponent.h"
#include "CustomVehicleMovementComponent.generated.h"
/**
*
*/
UCLASS()
class CHARACTERSYSTEMPLUGIN_API UCustomVehicleMovementComponent : public UChaosWheeledVehicleMovementComponent
{
GENERATED_BODY()
/** Update the engine/transmission simulation */
//virtual void ProcessMechanicalSimulation(float DeltaTime) override;
};
This is how I set the new component class
ABaseVehicle::ABaseVehicle(const FObjectInitializer& ObjectInitializer)
:Super(ObjectInitializer.SetDefaultSubobjectClass(AWheeledVehiclePawn::VehicleMovementComponentName))
{}
I also have to change it in the BP or it won’t compile
After doing all this, some vehicles don’t do anything, while others just start jumping around the map