O'Reilly logo

Unity 5.x Animation Cookbook by Maciej Szcześnik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To create a swipe transition effect, follow these steps:

  1. Open a scene.
  2. Create an Image in the Hierarchy. To do so, go to Game Object | UI | Image menu on the top of the screen.
  3. Image and Canvas game objects will be created in the Hierarchy.
  4. Select the Image game object and set its name to BlackScreen.
  5. Right-click on the Canvas game object and choose Create Empty to create an empty game object.
  6. Set the name of the newly created game object to FadeAnimator. This object will animate the effect.
  7. Set the Anchor Preset of the BlackScreen and FadeAnimator game objects to stretch in both X and Y coordinates the same way as we did in the previous recipe.
  8. Select the Canvas game object and add a Canvas Scaler component to it. We will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required