Expose Var to bp

Ok, disclaimer time: In all honesty, I don’t know a whole hell of a lot about this particular component. Is there a workaround to get the change in clutch strength to take at runtime? I’m not sure. However, that doesn’t mean you can’t try – the only thing you lose is time. And, at the same time, maybe gain a little more familiarity with how this thing is put together. But this is what I see:

Looking further in the .cpp where ClutchStrength is utilized, I see that SetupDriveHelper() is called from within SetupVehicleDrive(). DriveData (which is a PxVehicleDriveSimData4W) is passed in to this function. In the function itself I see:


PxVehicleClutchData ClutchSetup;
ClutchSetup.mStrength = M2ToCm2(VehicleData->TransmissionSetup.ClutchStrength);
DriveData.setClutchData(ClutchSetup);

VehicleData in the above is the UWheeledVehicleMovementComponent4W itself.

Later in the SetupVehicleDrive(), DriveData is passed to PVehicleDrive4W->setup(), and then at the end, PVehicleDrive4W is cached as both PVehicle and PVehicleDrive (why this is, I’m not sure).

Looking at the file that holds the declaration of PVehicleDrive4W’s setup() function (in PxVehicleDrive4W.h), it looks like there is nothing to provide an update to the drive data at runtime – it’s either create (allocate and setup a vehicle) or setup (set up an existing vehicle).

Like I said, you may want to play around and see if you can bend things to your will (i.e. copy code from the functionality I’ve pointed out above into your SetClutchStrength() code) to see if you can get it to work. But from what I’m seeing, this wasn’t intended for on-the-fly data changes. I’m sorry, man.

I do urge anyone who comes across this post and knows more about this component than I do to chime in if they know another way.