- Home /
Scaling problem , with different aspect ratio , 2d
this is my hierachy Canvas => Scroll Rect => Content => Canvas and under this last canvas is an Image as a background and a Sprite Renderer which has an animation
I did this while having in mind 16:9 aspect ratio but the problem is that when I change to 4:3 aspect ratio my background image scales ok since the first Canvas has a Screen Space - Camera as a Renderer Mode But my animation will not scale as I want it to.
Example :
I have some animated balloons that are being held by a child , the child is on the background image , so on different aspect ratio the balloons will be on "air"
Thanks for your time
This is because your animation record on local space. $$anonymous$$ake image child of Parent and then record animation on its parent will solve your issue. $$anonymous$$eep the child free or if its not issue with the animation the change canvas scale mode to scale with screen size.
I put my balloons under background image and then I create an animation on the background image and I animate the property of the child object ( balloons ) , is this what you're saying?
i want the small image to always stay always above the hens leg and not to be so off when aspect ratio is changed so basically i want both of the images act as 1
Answer by hgaur725 · Apr 04, 2017 at 09:57 AM
Change canvas UI scale mode to scale with screen size then try.
thats already set but unity seems to have some kinda of wierd functions with anchors for example if i have a small icon and i set its anchor to all corners of parent it wont keep its position on every aspect ratio but if i set its anchors to the closest corner it will keep its position on every aspect ratio
it is set as a full hd 1920x1080 reference resolution tho
set screen match mode to "Expand" in canvas scaler
Well, that's not the case, I mean you can keep the aspect ratio of your icon same for every screen. Suppose you having canvas>panel>icon. set the canvas UI scale to scale with screen size and then you can set anchors of your icon to let's say top left then you can do that by clicking on the anchor of an icon in inspector with alt and shift. Or maybe I will need any image reference of what you asking.
Answer by BeanBugDev · Mar 10, 2020 at 06:30 AM
Canvas Scale mode -> scale with screen size
Change your alignment from center-middle to stretch-stretch on the things you want to not be ruined by different screen ratios
Your answer
![](https://koobas.hobune.stream/wayback/20220612114639im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make my UI items/canvas stretch to fill preset aspect ratio 0 Answers
2D Animation does not start 1 Answer
EnemyAi animations, are bugged while moving 0 Answers
UI animation when car collides with the border of the track 1 Answer
How to change the sprite property of a 2d sprite light in unity urp? 0 Answers