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
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
You can check the current screen resolution with: Unity - Scripting API: Screen
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.