- Home /
Getting size of stretched RectTransform ??
How to get size(width and heigth) of stretched rectTransform ?? please help !
Answer by KristianBalaj · Nov 04, 2015 at 05:30 PM
Ok, I found out the solution in my case it worked if you need it than try it in your project and give me feedback. This returned me the right size ... rectTransform.rect.width ... and rectTransform.rect.heigth ... It worked for me also at stretched RectTransform.
But it doesn't work when stretched multiple times. Unity Requires 1 frame time to calculate them
this works but dont forget "yield return new WaitForEndOfFrame()" or it will give you right size after that.
Answer by GiyomuGames · Nov 04, 2015 at 05:32 AM
Have you tried multiplying width by localscale.x and height by localscale.y?
localscale doesn't work. It will give anything between 0 and 1.