how to change Sprite size without transform.scale property

if i scale a sprite , it will influence child gameobject, i just only want scale image self, how to? not the UGUI.

1 Like

As obvious as it sounds, the only real way to stop transform changes propogating into child is to ensure there are no children (which care about the Transform)!

So in your case, have your renderer as a child and organise your GO hierarchy appropriately.

1 Like

i dont like this way, can i change sprite’s height and width and keep scale (1,1,1);

If you were to look at the docs you’d see SpriteRender.size and as it states there, if your sprite DrawMode is set to Sliced mode then it has a size (scale) property which you can change as you like. It even appears in the inspector.

6 Likes

nice,very good,thank you