Unable to change tire config at runtime

I want to change the tire config on a single vehicle instance at runtime, however I’m unable to do that.

This is what I’m doing:

if (UWheeledVehicleMovementComponent* WheeledMovement = AffectedVehicle->WheeledMoveComp)
    {
      PRAGMA_DISABLE_DEPRECATION_WARNINGS
         
      UTireConfig* TireConfig = NewObject<UTireConfig>(this);
      TireConfig->SetFrictionScale(0.0f);

      PxVehicleWheels* PVehicle = WheeledMovement->PVehicle;
       
      OriginalTireConfigs.Empty();
      for (UVehicleWheel* Wheel : WheeledMovement->Wheels)
      {
        OriginalTireConfigs.Add(Wheel->TireConfig);
        Wheel->TireConfig = TireConfig;

        PxVehicleTireData PTireData;
        PTireData.mType = TireConfig->GetTireConfigID();
        PTireData.mLatStiffX = Wheel->LatStiffMaxLoad;
        PTireData.mLatStiffY = Wheel->LatStiffValue;
        PTireData.mLongitudinalStiffnessPerUnitGravity = Wheel->LongStiffValue;
        PVehicle->mWheelsSimData.setTireData(Wheel->WheelIndex, PTireData);
      }

      PRAGMA_ENABLE_DEPRECATION_WARNINGS
    }

If I’m not creating a new tire config object and instead use a tire config asset, the result is the same.

Increasing the friction scale slightly also doesn’t work.

I know about this thread:

[Content removed]

Steps to Reproduce

Hi Paul,

This ticket has been allocated against 4.27 - can I confirm if this is the version you are using please?

Best

Geoff Stacey

Developer Relations

EPIC Games

Hi Paul,

Apologies, a mixture of UE Fest and Holidays meant this fell between the gaps. However as it goes I actually met with a few of your colleagues at UE Fest specifically about physics (and potentially upgrading to 5.X).

As default we don’t tend to support versions this old, but what I can do is see if one of the devs can add some input about how best to do this. Let me ask and revert.

Best

Geoff

Hi Paul,

Are you calling RecreatePhysicsState after this change has been made?

Aha, fair enough! Glad to hear it it fixed.

All the best

Geoff

Hej Goeff,

Yes we are using 4.27 with PhysX.

I thought I selected that version when I made the post?

Bump

Hej,

I was calling that function.

The reason it wasn’t working was because we have another system im place in the vehicle movement component that’s already changing the tire config for the wheels, when the vehicle is frozen or “slipperly”.

So what happend is that it applied my tire config correctly, but then when the vehicle started to move the movement component would replace my tire config.