I want to add skid effect. But how can i detect tires skidding?

Hi,

I creating a 2D platform car game (Just like Hill Climb Racing)

I need to detect tires skidding, because i wan to add effect to tires when they skidding ( please look at below image)

6649621--759547--upload_2020-12-22_17-52-35.png

How can i detect skid? Thanks inadvance

no way?

If you know how many times wheels complete 360º rotation per second (angular speed), you can calculate the amount of distance they should move per second (linear speed). You can compare the linear speed to the actual speed of the car, if they do not match (use a tolerance value) then it is skidding.

1 Like

Hi, I want to detect tires are skidding in side car game just like “hill Climb Racing”

How can i do that? i’m using WheelJoint2D for tires

I have a simple solution for this. By this your car can have skid marks and tire smoke at the right moment

WheelHit hit = new WheelHit();
 
WheelCollider yourWheelcollider = GetComponent<WheelCollider>();
 
        if (yourWheelcollider.GetGroundHit(out hit))
        {
            if (hit.sidewaysSlip > .15)
                Debug.Log("drifting");
        }

Your solution posted on the 2D forum is to use 3D physics? The dev above is using 2D physics. :slight_smile:

Please create your own thread, please don’t hijack and necro old threads.