Hit flash, blink and silhouette modes
In your harnessGodot shaderMIT
Flash a sprite toward a colour when it takes damage: mix, additive or full silhouette modes, an amount to animate from a script, and an optional automatic blink for invulnerability frames.

What it takes and gives
- Shader type
- canvas_item
- Parameters
- flash_color (vec4 = 1, 1, 1, 1), flash_amount (float = 0), mode (int = 0), auto_blink (bool = no), blink_rate (float = 12), blink_duty (float = 0.5)
- Use it on
- A Sprite2D (or other textured CanvasItem) with transparent space around its shape, assigned to the node as usual.
- Result
- The sprite tinted strongly toward red as on a damage frame.
- Renderers
- compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
- Placement
- res://baltor/godot_shaders/sprite_hit_flash/
Limits. One flash colour at a time. Driving flash_amount per instance needs separate materials (or instance uniforms in your own variant).
Details
- Kind
- Godot shader
- Engine
- Godot 4.3 or later
- Files
- 11 files, 60.6 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
- Checks
- contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
- Techniques
- Colour blend modes, Square-wave blinking
- Tags
- godot shader, canvas item, hit flash, damage, blink, silhouette, 2d
- Identity
library.supply.creative_originals.1830234db7bcca39ee2f1e19.8e3aa09c10bb2789- Version
8e3aa09c10bb2789cc55867b3543c52dc8baa695593ace1f5e9d768b1bf99cfb
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.