Hello everyone! I can’t seem to figure out what’s wrong with my script. I know what the error means, not my first encounter with it. If anyone could spot an obvious error or something, that would help a lot. Thanks in advance.
static var MTopArray : Material[];
static var MBottomArray : Material[];
static var MHairArray : Material[];
static var MShoeArray : Material[];
var MTops : Material[];
var MBottoms : Material[];
var MHairdos : Material[];
var MShoes : Material[];
var playername : String = PlayerPrefs.GetString("Player Name");
var topInt : int = PlayerPrefs.GetInt("Top");
var bottomInt : int = PlayerPrefs.GetInt("Bottom");
var hairInt : int = PlayerPrefs.GetInt("Hair");
var shoeInt : int = PlayerPrefs.GetInt("Shoe");
var gender : int = PlayerPrefs.GetInt("Gender");
static var FTopArray : Material[];
static var FBottomArray : Material[];
static var FHairArray : Material[];
static var FShoeArray : Material[];
var FTops : Material[];
var FBottoms : Material[];
var FHairdos : Material[];
var FShoes : Material[];
var maleRenderer : Renderer;
var femaleRenderer : Renderer;
private var clothArray : Material[];
private var Top : Material;
private var Bottom : Material;
private var Hair : Material;
private var Shoe : Material;
function Update () {
if (CharEdGUIScript.gender == 0){
maleRenderer.enabled = false;
femaleRenderer.enabled = true;
}else{
maleRenderer.enabled = true;
femaleRenderer.enabled = false;
}
//errors point to these lines:
Top = MTopArray[topInt];
Bottom = MBottomArray[bottomInt];
Hair = MHairArray[hairInt];
Shoe = MShoeArray[shoeInt];
maleRenderer.materials = [Top, Bottom, Hair, Shoe];
Top = FTopArray[topInt];
Bottom = FBottomArray[bottomInt];
Hair = FHairArray[hairInt];
Shoe = FShoeArray[shoeInt];
femaleRenderer.materials = [Top, Bottom, Hair, Shoe];
}
[/quote]