Hit Flash Effect

3
  • 2 favourites

Stats

115 visits, 161 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Today we learn a simple way to add a hit flash effect, it is commonly used to signify to the player that an entity has been damaged.

The Set-up:

  1. Add the effect called Set color to the object that should flash and set it to disabled in the properties.
  2. Add the Timer behavior to that object as well.
  3. This is how the properties should look now:

    The Events

  4. Add a custom action (right-click the event sheet, select add custom action). Give it the name hitFlash and select that same object you added the Effect and Timer to.
  5. Add the action Set effect enabled and put in the name of the Effect "SetColor", make sure it's set to enable.
  6. Now add this action : Start timer for 0.2 seconds with the tag "hitFlash".
  7. Now add a new event with the condition On Timer and put in the same tag "hitFlash".
  8. Add the action Set effect enabled, this time set it to disable and put in the name "SetColor".

Now the events should looks like this:

You are done! Every time the object gets hit (for example "on collision with spikes") you can call the custom action you created and the Object will flash with the color set in the effects properties!

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!