Answer the question
In order to leave comments, you need to log in
How to get width value of 2d object in Unity?
How to get the width of an object? LocalScale.x returns one all the time. In Rect Transformation there is width = 19, if I manually substitute it into the code, then everything works as it should, but how to get this value through a variable?
Answer the question
In order to leave comments, you need to log in
The width of the RectTransform can be obtained from RectTransform.rect :float width = rectTransform.rect.width;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question