Changing a SpriteRenderer's Bounds
I'd like to change the dimensions of a SpriteRenderer via script. Most of Bounds' properties are read-only, so it looks like the only way to change its dimensions is to use the function SetMinMax():
spriterenderer.bounds.SetMinMax(Vector3.zero, Vector3.one);
From what I understand, this should put the sprite in a 1x1 square with its bottom-left corner at 0,0. But, I haven't successfully been able to do that. The Bounds' min and max points are untouched. Unity doesn't give me an error.
Am I using this function correctly? Anyone know why it's not working?
I'm using 5.2.1p2.
Your answer
Follow this Question
Related Questions
Sprite reach beyond gameobjects bounds size and causing design problems 1 Answer
Keep Top Down 2D camera in bounds of background sprite 3 Answers
How could I get a bounding box which is not aligned to the world coordinates? 0 Answers
Encapsulated bounds center error 1 Answer
Ordering my multi layered sprite characters (2D, Isometric) by the z Axis 0 Answers