Counter-direction implementation for a 2D drifting car

I could make a sliding car. but I want the address counter functionality. My current car model has 4 wheels, all of them have a script that handles the slip. I am currently multiplying the lateral speed by a value between 0 and 1 (such as 0.6 while fixed and 0.9 while sliding).

At first, all my wheels had a mass of 1, so the car slid very fast and spun like crazy. When I increased the dough to 20 each, the car slides normally. But the front of the car does not move laterally when turning in the opposite direction.

This is the code I have now for each tire

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class wheel : MonoBehaviour
    private Controls controls_i;
    private Rigidbody2D rigid_body;
    private Vector2 current_velocity;
    public bool rotate, power;
    public int rotation_angle, acceleration, max_speed;
    public float max_friction, min_friction, max_slip;
    // Start is called before the first frame update
    void Start()
        controls_i = GameObject.Find("Main_camera").GetComponent();
        rigid_body = gameObject.GetComponent();
    void set_angle(float angle){
        angle = Utils.linear_range(45, -45, rotation_angle, -rotation_angle, angle);
        Vector3 tmp = transform.localEulerAngles;
        tmp.z = angle;
        transform.localEulerAngles = tmp;
    void accelerate(float acceleration){
        if(current_velocity.y < max_speed){
            rigid_body.AddRelativeForce(Vector2.up * acceleration);
    // void apply_sideways_friction(){
    //     float sideways_velocity = current_velocity.x;
    //     float velocity_sign = Mathf.Sign(sideways_velocity);
    //     sideways_velocity = Mathf.Abs(sideways_velocity);
    //     float slip = sideways_velocity - max_friction;

    //     float updated_velocity = 0;
    //     if(slip > 0){
    //         slip = sideways_velocity - Utils.curve_map_linear(0, max_slip, min_friction, max_friction, slip, -1);
    //         updated_velocity = slip;
    //     }

    //     Vector2 new_velocity = transform.TransformVector(new Vector2(velocity_sign * updated_velocity, current_velocity.y));
    //     rigid_body.velocity = new_velocity;
    // }

    public float slip_threshold, stick_threshold;
    public float slip_drag, stick_drag;
    public bool slipping = false;
    void apply_sideways_friction(){
        if(!slipping && (Mathf.Abs(current_velocity.x) >= (slip_threshold * max_speed))){
            slipping = true;
        }else if(slipping && (Mathf.Abs(current_velocity.x) <= (stick_threshold * max_speed))){
            slipping = false;
        float drag = slipping ? slip_drag : stick_drag;
        float new_slip_velocity = current_velocity.x * drag;
        Vector2 new_velocity = transform.TransformVector(new Vector2(new_slip_velocity, current_velocity.y));
        rigid_body.velocity = new_velocity;

    // Update is called once per frame
    void FixedUpdate()
        current_velocity = transform.InverseTransformVector(rigid_body.velocity); 
        Debug.Log("* " + + " | " + transform.InverseTransformVector(rigid_body.velocity));



        Debug.DrawLine(transform.position, (Vector2)transform .position + rigid_body.velocity,, Time.fixedDeltaTime);
        Debug.Log( + " | " + transform.InverseTransformVector(rigid_body.velocity));

I'm looking for something like in the game "absolute drift"

I also tried wheel colliders. But the same problem happened there, the car slides but could not operate the drift of the opposite direction.

Basically, the player has no speed control. The car will accelerate at maximum speed on its own, slowly. The player can steer the car. When the player directs the car to the left or to the right, when the lateral impulse increases to a certain level, I want the car to start skating slowly and if the player does not turn in the opposite direction, the car will turn and stop, then will accelerate again. If he directs the opposite direction at the right time, I want the car to deviate. I don't want to code the exact drift logic as if the speed = n and the steering angle = x for y seconds add force to the front of the car. Because I want the user to try to drift and control it by going left and right to keep the car drifting.

What is the maximum safety time for a user to look at the controls of a car instead of the road?

And how should this be taken into account with the design of the touch screen controls in the vehicle?

Android wireless car for non-wireless panels

Is there a USB device that I can plug into the car that can connect via Wi-Fi to my phone and make Android Auto work wirelessly?

[ Maintenance & Repairs ] Open question: Yesterday I was in my car and when I got out I forgot and left my car lights on for 10 minutes.

It is still working, but I am not sure how much damage has been done to the car battery. How can I know if the battery is about to run out?

Car Gain – – HYIPs

Home 2019-12-29. PerfectMoney verified, 0.4 Trusted score points (United Kingdom GB.GIF "data-src =" "src =" "/> )
<p>Languages: EN
<img class=

Our program is aimed at people willing to achieve their financial freedom but cannot do so because they are not financial experts. is a long-term, high-yield private loan program, backed by the Forex market and investment in various funds and activities. The proceeds of these investments are used to improve our program and increase its long-term stability.

Investment Plans:

0.36% daily for 50 days (+ main)

Our deposit:

29.12.19 09:50 Transfer payment sent: USD 60.00 to account U21250414 from U1294xxx. Lot: 295714613. Note: Payment of the shopping cart. Deposit in User allhyips.


Minimum deposit: $ 30
Reference commission: 0.9%
Payments: Mamual
Features: SSL, DDOS


Registrar Name

Dates 81 days old
Created on 09/10/2019
Expires on 2021-10-09
Updated on 12/09/2019

Name servers
NS13.KODDOS.COM (has 333 domains)
NS14.KODDOS.COM (has 333 domains)


Tilt the car to accommodate larger tires

I would like to rotate the car so that the front wheels touch the ground without using physics.

The rear tires are on the floor but the front tires are not

As you can see, I want to rotate the car at an angle to, but making sure that both tires touch the floor. but it is a bit difficult since the central mass of the wheels is not the rear of the car.

Throwing animals in front of your car | Forum Promotion

You drive late at night in a safe but deserted neighborhood when a dog suddenly launches in front of your car. Although you hit the breaks, you hit the animal. Would you stop to see how hurt the animal was? If he did and discovered that the dog was dead but had a name tag, would he contact the owner?

Rent a car

APPOINTMENT (Gutman @ December 30, 2019, 03:32 p.m.) *

Where can I rent a car?

I rarely leave comments, but this is a special case. Hiring a Kia Rio for $ 24 a day is more than satisfactory for me. He inspired me. Run along the road and the car moves silently and smoothly. If you are not renting a car in Dubai on the radio, you can fall asleep from this comfort. I don't think I found a car anywhere cheaper, I like the company car. I have already remembered when to book this car when I am on vacation.

Is there a business in Santiago, Chile that rents cars on December 25 at night, apart from the car rental businesses located at the SCL airport?

I had booked a car at Santiago International Airport (SCL) with Budget, but they didn't really have any cars for me when I arrived. None of the car rental companies located at the SCL airport have cars available.

Is there a business in Santiago, Chile that rents cars on December 25 at night, apart from the car rental businesses located at the SCL airport?

Sale – Unique niche site for car programmers – Adsense

Why are you selling this site?

I have established it in your niche for a couple of years (that is, I managed to generate income + let it calm down a bit)

I am mainly a product seller and since this source of income is affiliated, it is not really my purse, so think that your next stage is with a new owner

How do you monetize?

Earn money through Google Adsense + Ebay affiliate (EPN)

Does this site come with any social media account?

No, could this be a good next level?

How long does this site take to run?

Almost nothing, I would log in to the administrator (WordPress) to check for updates, errors, etc. daily, but this could be weekly, etc. To the buyer.

What challenges exist to run this site?

None – just let it stand if you want too – it is profitable every year if you do

What is it?

The AK90 is a key programmer (for cars), it is not a specific website for him, so I created a niche to explain it a bit, offer a simple software download (freeware) and affiliate any sale of the real device through Ebay This method seems to be working and is profitable every year.

Specific details?

The site is registered with Godaddy,

The domain has been registered for 3 years and 66 days (at the time of writing this) – Renewal date: 2020-10-14, so there is still plenty of time for that!

Run WordPress with a clear theme, intelligent advertising positioning and simple structure.


See attached EPN revenue for this year, unfortunately EPN updated the entire system and I can't seem to see a way to get that information in recent years. I will get in touch with them.

I have linked the Adsense here, occasional income, but it all adds up. However, EPN shows a good profitable income.

Buy it now at a reasonable price of $ 35

Any questions feel free to send me a PM

Configure / install
I am happy to help install and configure also for the buyer

Note: I have also hidden this list of search engines to help with future SEO, etc.