Search Unity

Blinking eyes camera effect

Discussion in 'Editor & General Support' started by bryndaloo, Feb 26, 2011.

  1. bryndaloo

    bryndaloo

    Joined:
    Jan 27, 2011
    Posts:
    29
    Hello there

    Anyone have some useful tips for creating a blinking effect with the first person controller camera?

    For example having the player wake up and having the camera fade in, blink a few times and then clear view.
     
  2. Artimese

    Artimese

    Joined:
    Nov 22, 2009
    Posts:
    794
    its quite easy, but the blurry effect can only be achieved with unity pro, but if you want, you can use loadlevel fade that fades in the level from whatever color you want (black maybe) to clear.

    Code (csharp):
    1.  
    2.  
    3. if ( wakeup == true){
    4.     LevelLoadFade.FadeAndLoadLevel("Level1", Color.black, 3);
    5. }
    6.  
    7.  
    this will load the level called Level1, in 3 seconds, from black to clear.

    Blinking is a little harder to explain but easy to do... This is my algorthm

    Code (csharp):
    1.  
    2.  
    3. - Create 2 new gui texture, upper eye lid, and lower eye lid
    4. - create blinking texture in photoshop/paint/whatever
    5. - create a script that makes the gui texture move up on the upper eye lid, and down on the lower eye lid using Pixel Insert X, and Y.
    6.  
    7.  
    Hoped this helped and it was what your lookin for, maybe someone else can figure out a better way to do this im sure this is the best (without the need for unity pro)
     
  3. bryndaloo

    bryndaloo

    Joined:
    Jan 27, 2011
    Posts:
    29
    Hi

    Cheers for the tips. I managed to achieve an ok blinking effect by using the FadeInOut script from the unify forum and then animating two eye lids attached to the main camera to play on awake and then a destroy script to get rid of them after the animation has finished. It probably needs a lot of tweaking but looks ok. It was a very easy and light on scripting process. Ill post it up when I get the chance.
     
  4. bryndaloo

    bryndaloo

    Joined:
    Jan 27, 2011
    Posts:
    29
  5. zerotech15

    zerotech15

    Joined:
    Jan 28, 2016
    Posts:
    94