Modulate property breaking when used in AnimationPlayer on Sprite2D

Godot Version

Godot Engine v4.2.1.stable.official


I have a property track in an AnimationPlayer node which grabs onto the ‘modulate’ value of a Sprite2D. The track has three keyframes, one of them at the start of the track with an alpha value of 255 and another one midway through the track with another alpha value of 255. Then, at the end of the track there is one with an alpha value of 0.

However, instead of the sprite gradually going transparent as it transitions from 255 to 0 (I’ve even checked the animation’s in-between frames to see that it is changing, and it is) the sprite does nothing before vanishing completely when the alpha value goes to 1 or 0.

I’m completely lost on what could be causing this. I’ve been searching for any similar issues but I’ve found nothing.

Does the sprite have shader code attached that could be interfering?

Posting screenshots of animplayer config (tracks and each keyframe) and sprite config and code that triggers animation would help.

Make sure that the update mode of the track is set to Continuous More info Introduction to the animation features — Godot Engine (stable) documentation in English

Yup, this was the issue. There was a secondary shader track that happened before the modulate property was set to change and that overrode it. Fixed it by adding a new shader called ‘vanish’ which just altered the alpha layer and keying it in after the last one was done.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.