MassTrafficAI. The wheels on the right side of the car are turning in the wrong direction.

Hello everyone. I want to create traffic using Mass Traffic AI. I did it according to tutorial → https://www.youtube.com/watch?v=RRWr_Hnn5Bg

And everything worked out except the wheels. On the right side of the car the wheels are spinning the wrong way.

Here video with my problem → UE_Car_Traffic - Unreal Editor 2024-11-13 16-04-36.mp4 - Google Drive

The wheels are connected correctly:

Maybe something can be added to the blueprint to invert the direction on individual wheels? Help please!

I think I fixed it. It’s better to do this in some test project.

  1. You need to go to the folder:
    *…YOUR_UNREAL_PROJECT\Plugins\Traffic\Source\MassTraffic\Private*
  2. Open the file MassTrafficVehicleComponent.cpp
  3. Find function “FMath::Sign(WheelLocalLocation.Y)” and replace it with “-1”

it should turn out like this:

  1. Save this cpp file and close.

  2. Now you need to rebuild the project. To do this you need to install Microsoft Visual Studio 2022 with this addon “Game development with C++”. You may also need .NET SDK 6.0.302

  3. If you already have Visual Studio, then just run the project and click “Yes” when Unreal displays a message about rebuilding. After rebuild the project will open and the wheels should work correctly.

P.S.: This is of course a crutch and I don’t know how it might affect in the future. Perhaps now the wheels won’t be able to rotate backwards when reversing. I don’t know. But for now it was enough for me.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.