When Games compiled GUI all over the place

Well as the title says really, when i build my game the gui stuff moves to different places and doesn’t line up any more.

Are you using GUI with fixed rects for your GUI elements, or are you using GUILayout? Can you post some of your GUI code?

There must have been a compile problem or something wrong because it seems ok now apart from this radar script, i got from on here somewhere.
I use the MapCenter to put it in place but it moves when compiled.

@script ExecuteInEditMode() 




public var blip : Texture; 
public var amigo : Texture; 
public var radarBG : Texture; 
 
public var centerObject : Transform; 
public var mapScale = 0.3; 
public var mapCenter = Vector2(50,50); 

function OnGUI () { 
    
    //GUI.matrix = Matrix4x4.TRS (Vector3.zero, Quaternion.identity, Vector3(Screen.width / 600.0, Screen.height / 450.0, 1)); 

  
    bX=centerObject.transform.position.x * mapScale; 
    bY=centerObject.transform.position.z * mapScale; 
    bX=centerObject.transform.position.x * mapScale; 
    bY=centerObject.transform.position.z * mapScale; 
    GUI.DrawTexture(Rect(mapCenter.x-50,mapCenter.y-50,100,100),radarBG); 
    
    DrawBlipsForEnemies(); 
   DrawBlipsForFriends(); 
} 

function DrawBlipsForCows(){ 
    
    var gos : GameObject[]; 
    gos = GameObject.FindGameObjectsWithTag("Cow"); 
    var distance = Mathf.Infinity; 
    var position = transform.position; 


    for (var go : GameObject in gos)  { 
        drawBlip(go,blip); 
    } 

} 

function drawBlip(go,aTexture){ 
    centerPos=centerObject.position; 
    extPos=go.transform.position; 
        
    dist=Vector3.Distance(centerPos,extPos); 
   dx=centerPos.x-extPos.x; 
    dz=centerPos.z-extPos.z; 

    
    deltay=Mathf.Atan2(dx,dz)*Mathf.Rad2Deg - 270 - centerObject.eulerAngles.y; 
    
    bX=dist*Mathf.Cos(deltay * Mathf.Deg2Rad); 
    bY=dist*Mathf.Sin(deltay * Mathf.Deg2Rad); 
    bX=bX*mapScale; // escala la cordenada X para mostrarla en el radar 
    bY=bY*mapScale; // escala la cordenada Y para mostrarla en el radar 
    if(dist<=1440){ 
        
       GUI.DrawTexture(Rect(mapCenter.x+bX,mapCenter.y+bY,3,3),aTexture); 
    } 
} 

function DrawBlipsForEnemies(){ 
    
    var gos : GameObject[]; 
    gos = GameObject.FindGameObjectsWithTag("Enemy"); 
    var distance = Mathf.Infinity; 
    var position = transform.position; 
 
    for (var go : GameObject in gos)  { 
    drawBlip(go,blip); 
    } 
 } 
  
 function DrawBlipsForFriends(){ 
   
    var gos : GameObject[]; 
    gos = GameObject.FindGameObjectsWithTag("Amigo"); 
    var distance = Mathf.Infinity; 
    var position = transform.position; 
   
    for (var go : GameObject in gos)  { 
    drawBlip(go,amigo); 
    }    
}