Can't rotate or scale object
Hi everyone, I'm making a card game, and I can't rotate (or scale) my cards for some reason, neither in the editor nor by script. However, the positioning feature works well in both ways.
It should be noted that the cards are grouped in different empty gameObjects, which I can rotate with no problem.
This short video shows my problem (in the editor, no script)
Thanks in advance, Yoni.
Answer by Dizy · May 15, 2020 at 11:38 AM
This problem has nothing to do about Z or Y Axis. I think @yonisimian is just using Y rotation as exemple.
It seems that something override your inspector changes, check if any animation or a script update write access your transform rotation.
For exemple :
private void Update() {
transform.scale = new Vector(0.2, 0.2, 0.2);
}
Will prevent you from changing the scale (in inspector or in another script if only once)
@Dizy You're right, it was an animation that overrode my inspector and code's changes.
Thank you very much, have a nice day :)
Answer by DiscoFever · May 15, 2020 at 10:55 AM
Because in 2D you rotate on the Z-Axis ... not Y-Axis