Definining leftmost and rightmost edges

I want to be able to call the leftEdgeOfSpawner and rightEdgeofSpawner in other scripts. I know how to call functions and variables in other scripts, but why are my two floats erronious?

public class NMESpawner : MonoBehaviour {

	public GameObject enemyGape;
	public float spawnZoneWidth, spawnZoneHeight;
	public float leftEdgeOfSpawner = transform.position.x - (0.5f*spawnZoneWidth);
	public float rightEdgeOfSpawner = transform.position.x + (0.5f*spawnZoneWidth);

You need to assign your variables their value inside of a function, because you are initialising them using an instance member.

public class NMESpawner : MonoBehaviour {

   public float leftEdgeOfSpawner ;
   public float rightEdgeOfSpawner;

   void Awake()
   {
      leftEdgeOfSpawner = transform.position.x - (0.5f*spawnZoneWidth);
      rightEdgeOfSpawner = transform.position.x + (0.5f*spawnZoneWidth);
   }

}