- Home /
Change pixels per unit for an imported asseet, but only on x axis
Instead of changing the transform scale values of my imported asset, I thought it would be a better idea to change the pixels per unit and keep the scale to 1 on all axis. The problem is that my preferred scale of the asset is 0.45 on the x-axis and 0.34 on the y-axis. Is there any way to resize the image on the x-axis in unity without changing the scale property in the transform?
I have tried to just stretch the picture in pixlr.com (simple image editor) and while that worked fine, it made the image more blurry so is there any way for me to accomplish the same thing without quality loss?
Answer by pauldarius98 · Mar 02, 2021 at 07:04 PM
If this is about an UI image, then just uncheck the preserve aspect button and set the width (from the rect transform of the image) to any value that you want and the image will sttech/shrink in function of the values provided.
Unfortunately, it's not a UI image but instead a sprite
Oh, ok...Then I think that the Scale would be the way to go, depending where you want to attach the sprite. What you could do would be to add a separate transform just for your sprite (IE: like a child object for the object that you want your sprite on) and then you can change the scale of the transform whitout affecting the other components. If this is not the case, then please provide more infromations on what you want to achieve and where the sprite is going to be usef
Ok, thank you. I think I will just go with changing the transform scale value.