Best way to create drifting/How to access tireType dataAsset class & set frictionScale?

I’m creating a game that will involve racing and would like to know if theres anyway to handle drifting so that when a user goes around a corner at a high enough speed with the steering further than a certain amount the back wheels will lose grip/friction and slide (laterally I guess?).

In the desert racing game example I noticed in the C++ theres some stuff they play with to do with friction and wheels and lateral movement.

I got my tire array in my WheeledVehicled class and then casted to the back wheels of class VehicleWheel but theres nothing I can set there and its a data only class anyway and even going into the BP editor theres no variables I can set or functions i can override.

So is there any way I could acheive the ability for a car to lose traction and be able to tune it for a smooth racing experience or do I need to delve into the C++ for the VehicleWheel class (would even know where to begin unfortunately). I cant set the lat/long stiffness or anything during runtime.

Also the tiretype cant be changed during runtime since thats just a dataasset but it holds a variable called “FrictionScale” 2.0f at the front and 3.0f at the rear.

Tips, suggestions? Cant find much info on this.

Edit: If I try changing the wheel array using SetElem on index 2 and 3 (rear wheels) to a new type (a low friction setup) it crashes the editor with the following so obviously that cant be done either changing the array manually before runtime gets the effect i want though, slippery rear tires.



MachineId:BCB3380041472CC3F7A0BE87852B9091
EpicAccountId:c65b62b1fa284c35bef6b77d6c1e3eeb

Access violation - code c0000005 (first/second chance not available)

""

UE4Editor_Engine!UWheeledVehicleMovementComponent::TickVehicle() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\vehicles\wheeledvehiclemovementcomponent.cpp:743]
UE4Editor_Engine!FPhysXVehicleManager::Update() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\vehicles\physxvehiclemanager.cpp:278]
UE4Editor_Engine!FPhysSubstepTask::SubstepSimulationStart() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\physicsengine\physsubsteptasks.cpp:393]
UE4Editor_Engine!TBaseRawMethodDelegateInstance<0,FPhysSubstepTask,void __cdecl(void),PhysXCompletionTask * __ptr64>::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:582]
UE4Editor_Engine!TGraphTask<FSimpleDelegateGraphTask>::ExecuteTask() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\public\async	askgraphinterfaces.h:797]
UE4Editor_Core!FTaskThread::ProcessTasks() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\async	askgraph.cpp:539]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\async	askgraph.cpp:340]
UE4Editor_Core!FTaskThread::Run() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\async	askgraph.cpp:690]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:74]