Tracking position?

Hey. I have an object that is constantly moving along the x axis. When the object gets 1 unit past another object, I want to destroy the object. I am getting no errors, but my code is not working. What is wrong? Thanks

function Update(){
	var Player   = GameObject.Find("Player");
	
	if(transform.position.x==Player.transform.position.x-1){
		Destroy (gameObject);
		}
	
	transform.Translate(Vector3.right*1*Time.deltaTime);
}

It's probably not destroying your object because it's not hitting the "exact" position of Player.transform.x-1

e.g. : it may jump from yatta.x - 1.00023 to yatta.x - 0.99234 while translating and never hit the mark.

Try something like if(myYatta.x >= playerYatta.x -1 && myYatta.x <= playerYatta.x)
give it a range for a killzone rather than an exact position to hit.