Why Animation player refuses to wait for wait function?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By godot.ma.desive.logo

Here is my code:

if $T2.get_current_animation() != "":
        yield(get_tree().create_timer(8),"timeout")
        $T.play("animation2")

And the problem is $T starts immediately, although I expect it to start after 8 seconds of the timer.