Change Vehicle TransmissionSetup at runtime

Hello, I posted this question on the forums without lucky, i hope some one here can help me.

I’m working on a vehicle simulator and i want to change the DifferentialSetup in real-time, but i can’t find a correct way to do the change… My first approach was modifying the Vehicle4W->DifferentialSetup.DifferentialType value without success… then looking more in depth on how the engine creates the vehicles the function UpdateDifferentialSetup appeared, but this function is protected and i can’t access to it from my code… Is there a simple way to reach my goal?, i was thinking on recompile the engine with the function unprotected… but why the function is protected?

Thanks in advance.

Hi Tabriz.

It’s not good to change protected specifier in UpdateDifferentialSetup function.
Try to make your custom component derived from UWheeledVehicleMovementComponent4W and in it
define wrapper for this function.

Something like this:

void ChangeDifferentialSetup(const FVehicleDifferential4WData& NewDifferentialSetup)
{
    UpdateDifferentialSetup(NewDifferentialSetup);
}

Hope it’s help for you!

Best,