Has anyone figured out a way to make realistic skid marks based on the friction of the wheels of cars? I’m trying to make a script that makes the car wipe out if the wheels lose traction. I also only want skid marks if the wheel is actually sliding. I don’t think there’s any way to check how much frictional force is actually acting on a part at a given moment, so if anyone’s found an alternative I’m all ears Thanks!
-big
There is actually a way to calculate the skid of the car: The only force acting on the car is the tires, so as long as it doesn’t hit anything, by tracking the position / rotation of the car and calculating the force needed to accelerate it the way it is accelerating, you can figure out not just an approximation, but exactly how much force the tires are exerting and whether there is any slippage (at least down to the granularity of the physics simulation).
Doing that exact calculation is fairly difficult, but you could do a rudimentary one pretty easily (Just calculate the magnitude of the car’s acceleration and assuming that when it spikes very large then it must have hit something and the acceleration isn’t from the tires)
If your car is entirely physical and you actually want to calculate when the wheels are actually slipping then you would have to do the full harder calculation though (knowing the width of the car / tires, the rotational velocity of the tires, the linear and angular acceleration of the car, etc) It gets decently complicated and you would probably want someone who has taken a university level mechanics course to solve it for you.
Yea but even if you use another solution you’ll eventually need to raycast to make sure the car is on the ground.
I’d suggest a single raycast from center of the car every .2 seconds.
I’ve done this. Check if it’s sliding or drifting, and if it is then raycast from the center of each tire to .2 studs below the tire. If the ray hits pavement then activate the skid. If one is touching the pavement it will make a skidmark, independent of the other tires. If one is in the air it will not make a mark.