ClearCode tutorial - Fade To Black Animation fails totally

V 4.5.1

I have built the Transition scene with ColorRect and Animation player 3 times and cannot get the animation to work either in the editor or the game.

Simply no change to the ColorRect which has an initial key with full transparency which should animate to full black over 1 sec.

Any clues please?

1 Like

It’s impossible to tell without seeing your code or your node structure.
My only guess is that maybe your color rect is behind something, or it doesn’t span the entire screen.

1 Like

Although this is not addressing your specific issue with the AnimationPlayer, you may want to consider doing small animations like these using code:

var duration: float = 1.0
var tween := create_tween()
tween.tween_property(color_rect, ^"modulate", Color.BLACK, duration)

Tweens are ideal for small animations, as well as being more performant. Once you get the hang of them, you’ll forget how to use the AnimationPlayer.

Did you create a RESET animation for the AnimationPlayer? If not, that’s likely your problem. It would help if you could post a screenshot of your screen, including the scene tree on the left and the animation on the bottom.

Thanks for all the replies.
‘Bug’ fixed by colouring the ColorRect black with full transparency by default. The animation then changes the rect from transparent thru full black.

Old programmers, new tricks eh?

1 Like