WheeledVehicleMovementComponent4W can't set ClutchStrength

mchaconcr
Sun, 17 Mar 2019 03:53:54 +0000
World Creation

It seems like clutchStrength works fine on blueprints, I’m trying to modify this through on runtime using an axis (G29 clutch) value.
Initially I planned to extend the Vehicle actor class and set the clutch… but no… is not that easy… I have to extend the Vehicle Movement component… and use that component on my Vehicle class… Well I have that solved… then I thought it was going to work by changing the TransmissionSetup.ClutchStrength = [float whatever I want];. Well… no…
TransmissionSetup seems to be there just to "feed"the following:

/** update simulation data: transmission */
	void UpdateTransmissionSetup(const FVehicleTransmissionData& NewGearSetup);

Easy! I tried to think… but no… not that easy:

TransmissionSetup.ClutchStrength = force;
UpdateTransmissionSetup(TransmissionSetup);

Seems to work… no errors… it runs fine… but no clutch is updated… checking up WheeledVehicleMovementComponent4W.cpp I found this:

void UWheeledVehicleMovementComponent4W::UpdateTransmissionSetup(const FVehicleTransmissionData& NewTransmissionSetup)
{
#if WITH_PHYSX
	if (PVehicleDrive)
	{
		PxVehicleGearsData GearData;
		GetVehicleGearSetup(NewTransmissionSetup, GearData);

		PxVehicleAutoBoxData AutoBoxData;
		GetVehicleAutoBoxSetup(NewTransmissionSetup, AutoBoxData);

		PxVehicleDrive4W* PVehicleDrive4W = (PxVehicleDrive4W*)PVehicleDrive;
		PVehicleDrive4W->mDriveSimData.setGearsData(GearData);
		PVehicleDrive4W->mDriveSimData.setAutoBoxData(AutoBoxData);
	}
#endif // WITH_PHYSX
}

Where’s the clutch data being passed to the Physx vehicle???
And this is where I get completelly stuck!!!
Any help is appreciated!!!

2 posts - 1 participant