- Home /
UI Elements Move Animation Using iTween
I was using iTween for giving animation to each main menu elements. But animation not get played as per desire thinking, something different is running so I become confused about this for a solution.
I want to play game title, move animation from 1200 units to 0 unit using iTween move animation. But something like this, I was getting a result - it get stopped on -540 units:
This kind of code, I have written for UI Image move animation:
iTween.MoveTo (ballTitleObj, iTween.Hash ("x", 0f, "speed", 100f, "delay", 1f));
I know iTween work with Transform component and UI element with work RectTransform but what I require to do for a solution?
Answer by siddharth3322 · Oct 18, 2018 at 03:58 PM
Okay now spending enough time for this problem, I find at least one solution for this.
I started using DOTween rather than iTween: DOTween - Documentation
Its in-built contains support for Unity UI animations and I can able to get implemented easily within project. Here is the code line that worked for me:
ballTitle.DOAnchorPosX (0f, 1f, false).SetDelay (0.5f).SetEase(Ease.OutBack);
Answer by Jan_Julius · Oct 18, 2018 at 12:11 PM
If this only moves the element you could look into using https://docs.unity3d.com/ScriptReference/Vector3.Lerp.html
Even if there is an animation playing that also moves the element you could play the animation on a static position and move the element using lerp.
I'm not really sure what you are asking, the image doesn't really show anything?
no, I don't want to use Update method for moving UI elements of main menu page. I want to move the game title from one position (1200) to other position (0) ....
Your answer
Follow this Question
Related Questions
How to animate UI rect transform which works for all resolutions 1 Answer
Check if UI element is fully inside another UI element 1 Answer
How do I scale the Xmax value of a RectTransform 3 Answers
Accessing RectTransform Rotation? 1 Answer
Anchoring a UI image to the top of another UI image. 1 Answer