Determine whether a car is drifting or not (rear wheels)

Hello! I am trying to implement a script that detects whenever a car is drifting (with it’s rear wheels considering it is rear wheel drive). I am intending to play a tire squeek sound effect whenever this happens, however I am uncertain how to implement the code. I was thinking I could play the sound whenever the angle between the rear wheels’ velocity’s lookVector and the rear wheels’ lookVector is greater than the maximum turning angle of the front wheels?

Sorry to bump this. I was just looking for the same thing, and this topic showed up first which had no solution. After a bit of digging and searching, I’ve found this:

local sideVelocity = math.abs(VehicleSeat.CFrame:vectorToObjectSpace(VehicleSeat.Velocity).X)

This gets the sideways velocity of the, in this case, VehicleSeat. You can check if this is above a value to decide if the car is drifting or not.

if sideVelocity > 22 then (etc)

I’m not sure if this is the best way of checking but it works well for me and looks pretty good!

im not sure if you are still looking for a solution but hopefully someone in the future will find this helpful

9 Likes