Ok so using the code below I’m getting this error on line 11 “otherThing.animation[anims[a]].speed = animSpeed[a];”, but I can’t figure out why, I’ve tried it a lot and made sure that its all set right, each of the variable arrays have a size of 2. Is there something with my script or just a bug with unity?
EDIT: Oh also I put in a debug.Log and start seems to be calling twice???
var otherThing : GameObject;
var anims : String[];
var transforms : Transform[];
var layers : int[];
var animSpeed : int[];
function Start(){
for(var a : int = 0; a < anims.length; a++){
otherThing.animation[anims[a]].AddMixingTransform(transforms[a]);
otherThing.animation[anims[a]].layer = layers[a];
otherThing.animation[anims[a]].speed = animSpeed[a];
}
}