Change Tire on Runtime (BP/with a tiny bit of C++)

Updated Tutorial ;

Hey everyone,
So today i figured out how to change wheels on runtime. So you dont have to go trough the same annoyance i went trough heres how to set it up.

1 : click file -> new C++ Class -> BlueprintFunctionLibrary (in my case i named it TireLib)
2 : After that head over to your (Projectname).build.cs inside visual studio (Game/Projectname/Source/Name/Projectname.Build.cs)
3 : Make sure “PhysXVehicles” is in the dependencys (seen in screenshot)
4 : Populate the .hFile of your library (step 1)

#include "WheeledVehicleMovementComponent.h"

struct FWheelSetupBP

        // The wheel class to use
        UPROPERTY(BlueprintReadWrite, Category = WheelSetup)
        TSubclassOf<UVehicleWheel> WheelClass;

    // Bone name on mesh to create wheel at
    UPROPERTY(BlueprintReadWrite, Category = WheelSetup)
        FName BoneName;

    // Additional offset to give the wheels for this axle.
    UPROPERTY(BlueprintReadWrite, Category = WheelSetup)
        FVector AdditionalOffset;

    // Disables steering regardless of the wheel data
    UPROPERTY(BlueprintReadWrite, Category = WheelSetup)
        bool bDisableSteering;

class TESTCPP_API UTireLib : public UBlueprintFunctionLibrary

    static void modifyTyreConfig(UWheeledVehicleMovementComponent* Component, TArray<FWheelSetupBP> Tyres);

Make sure to replace tirelib with your filename

5: lastly go into the c++ part of the libary we created and include

void UTireLib::modifyTyreConfig(UWheeledVehicleMovementComponent * Component, TArray<FWheelSetupBP> Tyres)
    TArray<FWheelSetup> CTyres;
    for (int i = 0; i < Tyres.Num(); i++)
        FWheelSetup tire;
        tire.WheelClass = Tyres*.WheelClass;
        tire.BoneName = Tyres*.BoneName;
        tire.AdditionalOffset = Tyres*.AdditionalOffset;
        tire.bDisableSteering = Tyres*.bDisableSteering;
    Component->WheelSetups = CTyres;

After that you just have to compile and you will be able to setup your new tire seen in the Bp example.

Thank you Moddinggear over on Discord for helping me with the C++ and the setup.

If you have questions or issues please let me know below.

Rewrote the code No compiling issue. Was a pain to find the Updated Classes but it worked.