Drifting mechanice on a sphere based car controller

So im working on a kart style game and im currently using a sphere following car controller system by gamesplusjames https://www.youtube.com/watch?v=cqATTzJmFDY&t=242s thast the video so ive been working with it and im trying to add a drifting mechanic but im stuck i tried mix and jams video and script but i couldnt implement it with what im working with does anyone have any knowledge on how i can do this

Do you have to implement it yourself? If not, check the store, there are drift controllers and I remember at least one that was free.

Drifting means a lot of things to different people.

In reality it involves intentionally holding enough power and turn on a car to cause the drive wheels to slide laterally while not allowing the car angle to exceed an angle you can control by the available steering angle.

Right away you can see that most of those components simply do not exist in a sphere-driven car controller.

But since video games are simply simulations involving cherry-picked mechanics designed to give a specific impression, you could easily cobble something together on top of whatever existing car controller you have.

The first issue is to determine how hard you want to be turning before some “drift mechanic” is activated. One easy way is to compare the velocity vector between two frames and decide if it is big enough that you might be near the point you should skid.

For comparison of how much the velocity vector changed, you might want to use the dot product of the change in velocity with a vector 90 degrees to the right of your forward velocity, which would filter out hard acceleration and braking from the drift considerations.

Once you decide to activate the drift mechanic, then begin to increase the visible angle between the “straight” direction of the car, turning its nose more into the turn (oversteer) and perhaps emitting smoke from the wheels.

I am thinking that those two simple steps will give you the rudiments of a simple “drift mechanic” and you build upon it from there.

Otherwise, hie thee to some tutorials on making drift controllers, or else dig up one from the asset store as CodeSmile suggets.

thank you i was able to get some code that build upon the current system i have but i have a new question
How do i invert gravity i want to make it so at some point in the map the car the gravity inverts and the car drives on the ceiling ive been looking for how that concept works im totally new to unity and ive never programmed with c# before only python and html but i have a good understanding of how code works and can interprete it

also the drift code was from chatgpt i was able to tweak it to work
and it gives the sliding feel of drifting

im using this as a personal project and im challenging my self to do it without using external assets and addons tho i can use code i want to learn how to really use it since this where i want to build a carrer in the future