I have two different blocks, one called Resource and one called Extractor. How do I tell if they are right next to each other on the x axis? Here is the code I tried:
#pragma strict
var Extractor : GameObject;
var Resource : GameObject;
function Update () {
if(Extractor.transform.position.x == Resource.transform.position.x + 1 || Extractor.transform.position.x == Resource.transform.position.x - 1 ){
Debug.Log("Extract");
}
}