How to make a flashing danger sign using tween

self_module.a is a property whose values are on the range of 0 to 1 (See Color — Godot Engine (4.3) documentation in English), therefore your code should be something like this:

var tw = create_tween()
tw.tween_property(sprite_2d, "self_modulate:a", 1, 1)
tw.tween_property(sprite_2d, "self_modulate:a", 0, 1)

BTW, to properly format code in your posts, follow these instructions: Make it easier for new users to format and preview code in their posts - #4 by gertkeno

2 Likes