How to scale a non UI gameobject
I want to scale a 2D sprite with rigidbody attached to it according to the screen resolution. I must use a canvas or there is an another method for do it?
Thank to all in advance
Comment
Answer by DiegoSLTS · Aug 15, 2016 at 01:49 PM
You can check the current screen resolution with: https://docs.unity3d.com/ScriptReference/Screen.html
You'll have to scale the object manually, though. There's no "scale with screen size" setting for 2D sprites outside a Canvas, you'll probably want to scale things in the Awake method or something like that.
Your answer
Follow this Question
Related Questions
How can I scale UI text per resolution? 0 Answers
Unity 5 - Does anyone know how to scale the text in the UI? 1 Answer
UI not scaling with canvas 0 Answers