I'm programming a simple game, in which the player has to collect some objects. What I would like to do is that after he collects an object, the scene fades away for few seconds and then the player position is changed.
I know how to change the position, I have no idea how to make the fade away effect. I've tried using the Image Effect (such as Vortex and Blur) but I'm no able to slowly increment their variables (e.g. angle value for Vortex and blur iteration for blur) so that gives the impression of an animation.
Could someone guide me through this?
I have been doing similar stuff for an experimental 2D game recently. I found that the best way to do it is by using a really neat free library - LeanTween. You can use it on normal game objects and Unity UI elements. This is how a fade-out will look like.
LeanTween.alpha (gameObject, 0.0f, 1.0f);
The first parameter should be the game object you want to fade out, the second is the alpha value you're aiming for (0.0f will fade out the object completely), and the last one is the duration of the animation.