4
\$\begingroup\$

So I have googled how to do this already but all the answers were for older versions of unity and use things that are not applicable anymore.

I am trying to do is fade the screen to white when the player wins, followed by a change to another level that will have a video playing.

How do I do this in Unity 5 (preferably in C#)?

\$\endgroup\$
  • \$\begingroup\$ you could have an image the same size or larger than your viewport that is centred and pure white. Start off with this image as fully transparent and then lerp the transparency so it displays the blank white image. Once the lerp has finished, load your next scene. \$\endgroup\$ – Savlon Jun 2 '15 at 12:53
  • \$\begingroup\$ what would the could to change the transparency look like \$\endgroup\$ – Theuglysweater Jun 2 '15 at 13:12
  • \$\begingroup\$ docs.unity3d.com/ScriptReference/Color.Lerp.html docs.unity3d.com/ScriptReference/Color.html I'm on my phone so I can't post it, but read the links... They'll give you an idea of what to write. Obviously a transparent colour (white) is new Color (1, 1, 1, 0); //(R,G,B,A) \$\endgroup\$ – Savlon Jun 2 '15 at 13:17
  • \$\begingroup\$ youtube.com/watch?v=0HwZQt94uHQ \$\endgroup\$ – The_Monster Jun 5 '15 at 8:37
3
\$\begingroup\$

You can use the UI Canvas. Add a panel to the canvas and set the color to your preference. After you get that set up you could animate that panel to do anything from changing colors to custom sliding effects ect...

To implement something like this you would want

      Animator anim; 
     //in Awake()
      anim = GetComponent <Animator> ();

     // Tell the animator that the player Won.
      anim.SetTrigger ("Win");
     //then after the Win animation is finished trigger a Application.LoadLevel("yournextscene");
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.