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?
If this only moves the element you could look into using Unity - Scripting API: Vector3.Lerp
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?
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);