Building resets variables

Hi guys! I have a little question. I’m currently doing the Walker Boys tutorial and I’ve encountered a little problem.

I have cubes and spheres going around the screen. in a script common for both, I have a Boolean variable that tells if the object is a sphere (true) or a cube (false), the default is false. I then selected my spheres and set the variable to true in the inspector. But when I build the project, and try it, the variable seems to have been reset to the script default, because I see the spheres not doing what they’re supposed to do.

    // Enemy Script
      // Inspector variables
      var numberOfClicks : int = 2;// Hitpoints of objects
      var waitTime : float = 2.0; // time to wait   before respawn
      var shapeColor: Color[]; // Color of Object
      var explosion :Transform; // load particle effect
      var enemyPoints : int = 1;//Value of enemy
      var isSphere : boolean  = false;
      var alive		 		: boolean;
      var otherScript;

  // Private variables
  private var storeClicks : int;var sphere    : boolean  = false;

  // Start is called only once.
  function Start(){
	storeClicks = numberOfClicks;
	var startPosition = Vector3 (Random.Range(-5,5),Random.Range(-3,3),0);  //new random position for GameObject
	transform.position = startPosition; // relocate GameObject to new location
	RespawnWaitTime();
	otherScript = GetComponent(scriptMoveSphere);
  }

  // Update called every frame
  function Update () {

	if(numberOfClicks <= 0){
		
	  if (explosion){
	    Instantiate(explosion, transform.position, transform.rotation);   // Create explosion
		}
		RespawnWaitTime();
		if (isSphere){
			otherScript.initialPosition = Vector3 (Random.Range(-5,5),Random.Range(-3,3),0);  //new random position for GameObject
		}
		else{
			var position = Vector3 (Random.Range(-5,5),Random.Range(-3,3),0);  //new random position for GameObject
		}
		transform.position = position; // relocate GameObject to new location
		numberOfClicks = storeClicks;
	}
  }

  // RespawnWaitTime is used to hide the GameObject and show it again after a set amount of time
  function RespawnWaitTime(){

	renderer.enabled = false;
	alive = false;
	if (isSphere)
		waitTime = Random.Range(1,3);
	yield WaitForSeconds(waitTime);
	RandomColor();
	renderer.enabled = true;
	alive = true;
}

  //RandomColor is used to change the color of the GameObject
  function RandomColor(){

	if (shapeColor.length >0){
		var newColor = Random.Range(0,shapeColor.length);
		renderer.material.color = shapeColor[newColor];
	}
}

I cannot use different tags because they’re already use for a check in a raycast hit.

Has anybody an idea of how I could solve this problem?

Ok, new answer.

Add this to your start function and it should be fine.

 function Start(){
    if(collider.GetType() == SphereCollider){
    isSphere = true
       }
    storeClicks = numberOfClicks;
    var startPosition = Vector3 (Random.Range(-5,5),Random.Range(-3,3),0);
    transform.position = startPosition; // relocate GameObject to new location
    RespawnWaitTime();
    otherScript = GetComponent(scriptMoveSphere);
  }

This will tell the script when it starts whether its attached to a sphere or not.