Script works in editor but doesn't when i build the game :????

Hello!As the title says i have a script that for some reason works perfectly in the editor,but doesn’t work when i build the game :face_with_spiral_eyes::face_with_spiral_eyes::face_with_spiral_eyes:

Here’s the script :

var planetGos : Transform;
var planet : Transform;
var maxim : float;
var minimum : float;


function Start(){

planetGos = transform;
planet = transform.parent;

InvokeRepeating("Check",0.0,1.0);

}

function Check(){

DistToPlanet = Vector3.Distance(camera.main.transform.position, planet.transform.position);

for (var obj : Transform in planetGos )
{

//--------------------------------------------------------------
var seed = obj.GetComponent("Seed");

if(seed.Step == 0){maxim = 2000.0;
minimum = 550.0;}
if(seed.Step == 1){maxim = 850.0;
minimum = 150.0;}
if(seed.Step == 2){maxim = 200.0;
minimum = 125.0;}
if(seed.Step == 3){maxim = 175.0;
minimum = 0.0;}
//--------------------------------------------------------------

var script = obj.GetComponent("FinalScript32");
var render = obj.GetComponent(MeshRenderer);

var dist : float;

if(render){
dist = Vector3.Distance(obj.gameObject.renderer.bounds.center, camera.main.transform.position);
}
if(render == false){
transform.localScale = transform.parent.localScale;
dist = Vector3.Distance(obj.position, camera.main.transform.position);
}

//--------------------------------------------------------------
if(dist < maxim  dist > minimum  render == false){ //these "if" blocks just don't work ;(
if(script){script.enabled = true;
obj.gameObject.active = true;
transform.localScale = Vector3.one;
}
}

if(dist < maxim  dist > minimum  render){ //these "if" blocks just don't work ;(
obj.gameObject.active = true;
transform.localScale = Vector3.one;
}

if(dist > maxim || dist < minimum){obj.gameObject.active = false; //these "if" blocks just don't work ;(
transform.localScale = Vector3.one;
}

//New tester

if(DistToPlanet < 350.0  seed.Step < 3){ //these "if" blocks just don't work ;(
obj.gameObject.active = false;
}

//--------------------------------------------------------------
}
}

As a baisic ideea,what could happen so that this works when i run the game in the editor,but not when i build it?:face_with_spiral_eyes::face_with_spiral_eyes:
Please help me :frowning:

maybe you try puting InvokeRepeating(“Check”,0.0,1.0) outside of the start function?

It is not because of the InvokeRepeating :frowning: I even tried to delete it,and make Check function an Update Function…Check function would work if replace the if blocks with simply “script.enabled = true;”…So for some reason,only those “if” blocks wont work ;(
Please helppp!!

*FIXED!
For some reason it had a problem with “render == false”.I should have used “!render” or use “else”
Still kinda wierd that it worked in the editor and in the actual game,not >.>
Thanks for your help!