Steering Wheel Problem

Hey

I have this code to making a steering wheel:

var rotationSpeed : float = 100.0;

function Update () {

        var rotation : float = Input.GetAxis("Horizontal") * -rotationSpeed * Time.deltaTime;   

        transform.Rotate(0, 0, rotation);
}

It is working ok but I need the steer to comeback to the original position when I stop pressing the arrow keys. How can I do that?

I tried using Quaternion.Slerp but I can't define the original position to comeback to.

Thanks for any help

Create a quaternion variable to store the default rotation in local space on awake or start, then you can lerp/slerp just fine from transform.localRotation to that variable.

My problem is solved thanks to Alec Slayden, here is the code:

var rotationSpeed : float = 100.0;
static var origRotation : Quaternion;

    function Awake () {

        origRotation = transform.localRotation;
    }

    function Update () {

            var rotation : float = Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime;   

            transform.Rotate(0, rotation, 0);

            transform.localRotation = Quaternion.Slerp(transform.localRotation, origRotation, Time.deltaTime);
    }