Forum rules - please read before posting.

Creating a screen flash effect

edited October 2020 in Technical Q&A

Hello AC community!

Has anyone created a screen flash effect, or know a way to create one using AC? For example, having a screen briefly flash a white color once, then the screen returns to normal.

Searched through the forum, though haven't seen anything related to that.

I tried using the Camera: Fade Out action (with a custom fade texture of a white pixel image). Then Camera: Fade In. This didn't show a flash or fade effect in the current scene.

Then, tried another method below already, though this also doesn't seem to work.

First, I used this method to create a white rectangle that covered the screen ("+" symbol -> 2D -> Sprite. Create a 1 pixel white sprite image, and resize/make larger to cover the screen using "Scale" under "Transform".)

Then, I assumed that AC's Object: Fade Sprite would do the trick. Added one Action that did a "Fade In" with a duration of .25 sec., then added another Action that did a "Fade Out", with a duration of .25 sec. Also added the "Sprite fader" component to the sprite, as the AC manual mentioned to do when using "Fade Sprite".
Though this didn't work to show a quick flash -- nothing shows.

What's interesting is that I removed these Actions to test further, and the white rectangle doesn't seem to show at all in "Play" mode. Though it's definitely visible on the screen when not in "Play" mode.

Realize that this issue may not be related to AC, though I'm looking for any advice on how a screen flash effect can be created in AC -- either by building on the idea I already tried; Or using another completely different method.

Using AC 1.71.8, and Unity 2020.1.4f1.

And advice is greatly appreciated!

Comments

  • Both of those methods should work. With the sprite method, you'll need to make sure that the sprite is visible in the Game window at runtime before you try animating it. Was it visible in the Game window in Edit mode? It may be down to its position along the Z-axis, or its Sprite Order value relative to other objects in the scene.

    The camera-fade method should work too. Did the screen at least turn white when fading out? Check the Console for messages.

    Creating a full-screen menu would be another approach. If you made a menu that showed a white texture covering the whole screen, you could then give it a transition and use the Menu: Change state Action to turn it on and off.

  • The Z-axis value was indeed the issue with the white sprite method. The sprite's position was behind the game camera.

    That method works, though since the white sprite covering the screen it means that Object: Visibility also needs to set it to "Invisible" in each "OnStart" Actionlist in the scene in which the effect would appear -- and the flash effect will happen in several scenes throughout the game.

    In any case, the **Camera: Fade In/Out ** would be preferred, if they are meant to be for such an effect , and are able to create it. It would be more straightforward.

    Did the screen at least turn white when fading out?

    Camera Fade Actionlist settings:
    https://imgur.com/a/egRnXvC

    Using these settings, basically it goes to black, transitions to the normal screen view (the regular color scene view), then fades in to white, then remains at a white screen which never goes away.

    Check the Console for messages.

    There was nothing that shows in the console regarding it.

    I appreciate the advice given so far. Thank you again for you assistance, if there's anything else that can be shared.

  • it means that Object: Visibility also needs to set it to "Invisible" in each "OnStart" Actionlist in the scene in which the effect would appear

    As an alternative to an initialisation Action, attach a Remember Visibility component and set the Visibility on start property to Off.

    Using these settings, basically it goes to black, transitions to the normal screen view (the regular color scene view), then fades in to white, then remains at a white screen which never goes away.

    That matches up with the Actions you've shared - you're fading in (from the default black) and then fading out (to white).

    If you want to briefly flash white, fade out to white (the second of the two Actions you have), and then fade in from white.

  • Thank you!

    Seems I had the "Fade In" and "Fade Out" actions reversed for a flash effect. Switching their order did the trick.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.