How would one implement wheelhit to simulate phyisic materials in racing game?

I’m fairly new to unity and I’m working on a racing game that uses wheel colliders and would also like to create the effect of slowing down when you drive off of the track. My first guess was to simply make the terrain a different texture since the track is its own object, but I soon figured out that wheelcolliders aren’t affected by regular physics. After some searching on the script reference page I came across using something called wheelhit to change the friction of different collisions. It didn’t really go into much detail, and I have no idea how to implement this, so could anyone point me in the right direction as to where and how you’re supposed to script this kind of behavior?

Have you looked through the source code of the Unity Car Tutorial?

That has more than enough code to show you how to do what you want.

There are other ways to accomplish this too, such as increasing rigidbody drag when off the track etc… while not the ‘right’ way to do it, it works.