Slot machine smooth reel spin.

I created a slot machine with 5 reels and using sprites i added the elements to the reels and i created the spinning using the following code
the reels are spinning but not stopping in even liking showing half image of the above element and below elements as show below

alt text

var TargetNumber:int ;
var TargetRotation:float = 0;
static var SpinUp:boolean = false;
function spin()
{
  TargetNumber = Random.Range(0, 9);
  TargetRotation = TargetNumber * 2.0f;
  SpinUp = true;
  Invoke("EndSpin", 1);
}
 
function EndSpin()
{
  SpinUp = false;
}
 
function Update()
{
  if(SpinUp)
  {
  	var offset : float = Time.time * TargetRotation;
    renderer.material.mainTextureOffset= Vector2(0, offset);
   }
 }

Add a line of code after line 14 that says exactly this

renderer.material.mainTextureOffset = = Vector2( 0, TargetNumber*2.5 );

you can see the line numbers on the left

if that doesn’t work try TargetNumber2.0 or TargetNumber1.5 or TargetNumber*2.5

Let us know how you go.