I have a vehicle traveling in a forward motion, and for the most part I always want its rotation to be 0,0,0 (it can “strafe” but not turn).

There are some stationary obstacles with standard colliders. When the vehicle hits one, it knocks the vehicle around a bit but I want the vehicle to then correct its orientation and continue moving forward at a rotation of 0,0,0.

Here are a few things I’ve tried that aren’t working:

First I’ve tried just doing a continual correction with some smoothing, like this:

```
_rb.rotation = Quaternion.Lerp(_rb.rotation, Quaternion.Euler(0, 0, 0), smoothing * Time.deltaTime);
```

Where _rb is the vehicle’s RigidBody and smoothing is a float (set around 10). This almost works, because it does correct the orientation a bit, but of course the problem with this kind of smoothing is that you never reach the target value of the lerp. It just makes exponentially smaller increments towards it. At some point I have to reach 0,0,0 or the vehicle drifts off to a side rather than moving straight.

I also tried setting up a time-stepped lerp. I gave a total time and then on collision I set a timer to that value and then calculate the steps like this:

```
if (_timer > 0)
{
float step = 1 - (_timer / forwardCorrectionTime);
_rb.rotation = Quaternion.Lerp(_rb.rotation, Quaternion.Euler(0, 0, 0), step);
_timer -= Time.deltaTime;
}
```

This sort of works if I set the correction time to something reasonably long, like greater than 5 seconds, but I want the correction to happen more quickly. If I lower the time then it will perform the correction, but then the ship jukes back to an incorrect rotation - I’m guessing that perhaps the physics engine is still performing the effects of the collision after the corrective rotation.

The only reliable method I’ve found is simply forcing the rotation instead of using a lerp, but this of course kills the effect of the collision and is not what I’m going for.