I have an AnimationPlayer with several animation. One of them darkens the sprite2D by modifying the modulate property from Color(1,1,1) to color(0.2, 0.2, 0.2). No other animation (walk, attack...) has a key on the modulate property.

Now. When the animation is executed, the sprite darkens, then sometimes it stays dark afterwards (which is the desired effect) and sometimes it returns immediately to standard colors, i.e. as if I had put a modulate = Color(1,1,1) somewhere.

But I didn't. Not in the code, nor in the animations.

So, what's going on? Is this a bug? "Yes, in YOUR code man!". Ok, Ok. But I mean, if it ALWAYS resetted the color after the animation I could understand. But it seems completely random to me. :\

Also I tried to "cheat" by waiting for animation to finish AND putting another modulation afterwards, but it does not change anything.

I guess I could just cheat more by adding to the _process and "if" condition to CONTINUOUSLY modulate the sprite2d when it has to, and it will work (will it???), but... wtf guys. :\

    nerdino you have to set this in your RESET animation.
    the RESET animation is used when a keyframe is missing from an animation, like when an animation doesn't change modulate.
    setting the RESET modulate to 1 1 1 will make it so the sprite is white whenever modulate is not being animated.

    a different way to change modulate is to use a Tween to go from white to black, that way it will stay black after it finishes, and can be run from code at any point alongside any other animations.