Help on changing scenes

Question

So I created this fade in animation as an intro, it’s supposed to change to the next scene called menu but it’s not doing it.

extends Node

@onready var intro_sfx: AudioStreamPlayer = $intro_sfx

func _ready() -> void:
	intro_sfx.play()
	$AnimationPlayer.play("Fade_in")
	
	await $AnimationPlayer.animation_finished 
	
	get_tree().change_scene_to_file("res://menu.tscn")
	print('changed')

the print line is for debug which it isn’t printing so I know something is wrong

I think you just forgot to attach the script to the Node.

3 Likes

It worked! Thank you so much!