I downloaded a simple 2d character asset from the assets store
And this prefab consists of different parts with different Z position
[139579-снимок-экрана-2019-06-06-в-135829.png|139579]
However, when I enter to play mode, everything is fine, until I actually change its scale (programmatically): the z position of every object becomes the same: [139580-снимок-экрана-2019-06-06-в-140133.png|139580]
Here is my script:
if(Input.GetKey(KeyCode.D)){
this.transform.localScale = new Vector2(-1, transform.localScale.y);