Search Unity

how to do slide in/out animation of popup window

Discussion in 'Animation' started by andrew_pearce_, Jun 3, 2019.

  1. andrew_pearce_

    andrew_pearce_

    Joined:
    Nov 5, 2018
    Posts:
    169
    Hello,

    Is there any way to use built in Unity animation system to make popup window slide in from top and slide out to the right when canvas' w/h ratio is variable (different mobile screen sizes).

    If popup's anchor would be top right corner then there are no issues because its position will remain same all the time. However, in real life scenario, the anchor is usually center of the canvas.

    Currently, DOTween does the job but I would like to know if I can do the same with native animation.

    Thanks in advance

    IMPORTANT: I tried to place popup far from top and right borders but that will make animation duration slower or faster, depending on how much actual top/right values differ from the values I used when I was creating animation.