Animating slide-in from side of screen

I animated a Text object to slide in from the left of the screen, stop at the centre, then slide out the other side. It all worked perfectly until I started testing with different aspect ratios and resolutions. I can’t think of how to ensure the the Text RectTransform lines up with the screen edge at the start and end of the animation.

Has anyone got any tips on how to do slide in/out animations for GUI elements?

The anchors can be animated. You can set the anchors to be at the left side at the start, stop in the center, and then go to the right side at the end.

Basically, the same way you use anchors to ensure correct placement for different aspect ratios in a static layout can also be used with animation.

4 Likes

Thank you that worked perfectly!