Rotating GameObject with transform.Rotate issue!

Hello,
I just ran into another issue, I’m trying to rotate a needle to depict a speedometer, I’m getting the following error, see below:

Code:

var currentSpeed : float;
var SpeedNeedle : GameObject;

function Update () {
carsSpeed ();
Speedometer ();
}


function Speedometer () {
var speedFactor : float = currentSpeed;

var rotationAngle : float;

if (currentSpeed >= 0){

  rotationAngle = Mathf.Lerp(0,180,speedFactor);

  }

  else {

  rotationAngle = Mathf.Lerp(0,180,-speedFactor);

  }
 SpeedNeedle = transform.Rotate(0,0,rotationAngle, Space.Self);
}


function carsSpeed () {

//Getting current speed of the tire for engine sounds	
currentSpeed = rigidbody.velocity.magnitude * 2.237 * Time.deltaTime;
	
}

Here is the Error:

[13769-screen+shot+2013-07-31+at+6.12.15+pm.png|13769]

Thanks for the help
Daniel

PS: I take the time to Mark and rate correct answers.

Your problem is this:
SpeedNeedle = transform.Rotate(0,0,rotationAngle, Space.Self);

SpeedNeedle is of type GameObject. If you look at the documentation for Transform.rotate, you will see that it returns void. The fix is that instead of setting it equal, you should do this:

SpeedNeedle.transform.Rotate(0,0,rotationAngle,Space.Self);