Fading in/ out of scene not working on button press

Godot Version

Question

So I’m new to Godot and I followed this tutorial: https://www.youtube.com/watch?v=Hz9-j3ceDag&t=818s to create a fade in/ out animation for switching scenes on a button press but nothing is happening- what did I do wrong? Note: the transition scene/ script is held within the transition node on the tree, it has within it an animation player with the animations “fade out” (yes, without the underscore- I messed up :confused: ) and “fade_in”

transitioner script:

extends Control


class_name Transitioner
@onready var anim_texture : TextureRect = $TextureRect
@onready var animation_player : AnimationPlayer = $AnimationPlayer

func _ready():
	anim_texture.visible = false

func set_next_animation(fading_out: bool):
	if (fading_out):
		animation_player.queue("fade out")
	else:
		animation_player.queue("fade_in")

button code:

extends Button

@export var transitioner : Transitioner



func _on_pressed(button_press):
	transitioner.set_next_animation(button_press)

Godot Version

4.1.3

Could I ask you to set a Breakpoint at

func _on_pressed(button_press):
	transitioner.set_next_animation(button_press)

and see if it actually goes into the method?

I assume that your statement

but nothing is happening

means that your button press is registered but the animation_player does not play “fade out” nor “fade_in”, am I correct?
I will also assume that you did not typo’d your animation names because “fade out” does not have an underscore.

yes it doesn’t play- I accidentally named fade out without an underscore so that’s why its not in the code- but I’ll try adding a breakpoint!

By the way, I wanted to ask you why you did animation_player.queue("fade out") instead of animation_player.play("fade out")?

You usually only queue an animation when there is currently another animation playing. Also if that is the case, could it be that the current animation (whatever it is) is configured to loop endlessly?