- Home /
keep sprite same size when changing
GetComponent<SpriteRenderer>().sprite = NewSprite;
It works but it changes the sprites sizes. How do I stop this?
Comment
Best Answer
Answer by Shippety · Jan 09, 2019 at 11:34 PM
It's probably because the other sprite is just bigger. Try going into the asset window and changing NewSprite's pixels per unit so it matches the size of the original sprite you're using.
Your answer
Follow this Question
Related Questions
How to set sprite size in pixels? 2 Answers
Fixed Sprite Size in every monitor Screen 0 Answers
WebGL sprite appears pink? 0 Answers
2 Animation Clips, 1 Sprite 0 Answers