Hi all, i want to resize transform.localScale.x or Y or Z, depending on user input, it works with 3 if statements to select x/y/z, but if i try the following, it uses the wrong variable. Is it possible to select x/y/z using an array?
var cls1 = [ childs[ws].transform.localScale.x , childs[ws].transform.localScale.y , childs[ws].transform.localScale.z ];
cls1 [userSelectorSlider % 3] *= 2;
// it doesnt resize the gameobject because cls1[] is a variable.
this works:
if (userSelectorSlider % 3 == 0) { childs[ws].transform.position.x *= 2; } // Yodamod
if (userSelectorSlider % 3 == 1) { childs[ws].transform.position.y *= 2; }//best sym axis = y
if (userSelectorSlider % 3 == 2) { childs[ws].transform.position.z *= 2; }