#UI animation Lean Tween

1 messages · Page 1 of 1 (latest)

stone matrix
#

How can I animate my UI elements that has the same animation for every resolution in unity.

stone matrix
#

Hello there for someone searching for this, I spent 3 hours looking for the answer surprised to find the answer nowhere.

#

The answer is fairly simple before I was using the gameobject's transform to move the object that would work completely fine for the given resolution but as soon as you change the resolution it wouldn't work.

#

Instead of it you should use the " Rect Transform " component to move the position as I had anchor on UI gameobjects

#

So, The code would be :

#

<RectTransform>.LeanMove(new Vector3() , time):

#

instead of:

#

<Transform>.LeanMove(new Vector3() , time);