How to Make a Sprite Flash | Unity Ping Pong Function Explained

Опубликовано: 28 Декабрь 2025
на канале: Ketra Games
4,222
107

In this Unity tutorial we're going to look at how to make the player’s sprite flash when they’ve taken damage and are invincible.

We'll cover how to create a coroutine to change the colour of the sprite over time and how to use the Ping Pong function to create the flash effect.

This is the seventeenth video in our series showing how to make a full top down 2D shooter game in Unity.

The playlist for this series can be found here
►    • Unity 2D Top Down Shooter for Beginners  

The project files are available to our patrons here:
►   / 94928815  

Want to follow along? This project is a good starting point
►   / 93282900  

The full Top Down Shooter Project is available to our patrons here
►   / 75231350  

The final script can be found here
► https://dotnetfiddle.net/t5aEJL

Help support our work:
► Patreon:   / ketragames  

Follow us:
► Ketra Games: http://www.ketra-games.com
► Patreon:   / ketragames  
► Twitter:   / ketragames  
► Facebook:   / ketragames  

Introduction - 0:00
Creating the Sprite Flash Script - 00:34
Explaining the Ping Pong Function - 04:32
Triggering the Flash when the Player is Invincible - 06:46
Summary - 09:56

#KetraGames #LearnUnity #UnityTutorials #UnityTips