Hello,

I'm trying to track one of my characters as it moves across my stage, however it seems that samuraiChar's (my character) x position has a much higher decimal rounding system in place rounding to maybe 8 decimals where as the over object that I'm trying to track with it has only a 2 d.p rounding system. Can someone explain to me why this is and how I can fix it, also I may be wrong I'm not 100% sure if this is the problem.

Thanks, heres the code.

This method is sending the variable to the samuraiChar
Code:
	public function moveSamurai():void{
			if(samuraiXDirection == 1){
				if(samuraiVelocity < Util.maxSpeed){
					samuraiVelocity += Util.acceleration;
				}
			}
			else if(samuraiXDirection == 2){
				if(samuraiVelocity > -(Util.maxSpeed)){
					samuraiVelocity -= Util.acceleration;
				}
			}
			if(samuraiVelocity >= 0.5 || samuraiVelocity <= -0.5)
				samuraiVelocity = samuraiVelocity * Util.speedDecay;
			else samuraiVelocity = 0;
			samuraiXPos += samuraiVelocity;
			SamuraiChar.move(samuraiVelocity, samuraiYMove, samuraiXDirection);
		}
Code:
public function move(x:Number, y:Number, moving:int):void{
			if(x > 0 && moving > 0){
				currentlyAttacking = false;
				facingLeft = false;	
				currentlyMoving = true;				
				if(samuraiXPos < currentLevelWidth + (Util.PLAYABLE_WIDTH/2)){
					if(moveToEdge){
						samuraiChar.x += x;
						collisionBox.x += x;
					}
					samuraiXPos += x;
				}
			}
			if(x < 0 && moving > 0){
				currentlyAttacking = false;
				currentlyMoving = true;
				facingLeft = true;
				if(samuraiXPos > 0){
					if(moveToEdge){
						samuraiChar.x += x;
						collisionBox.x += x;
					}
					samuraiXPos += x;
				}
			}
			if(moving == 2)
				samuraiChar.gotoAndStop(4);
			else if(moving == 1)
				samuraiChar.gotoAndStop(3);
			if((x == 0 || moving == 0) && ((samuraiXPos + x) >= 0 && (samuraiXPos + x) < (currentLevelWidth + (Util.PLAYABLE_WIDTH/2)))){
				if(moveToEdge){
					samuraiChar.x += x;	
					collisionBox.x += x;
				}
				samuraiXPos += x;
				currentlyMoving = false;
			}
			trace(samuraiChar.x);
			trace(collisionBox.x);