Code of VideoStreamPlayer isn't working for cutscene

Hi! I have Godot 4.6 and this code isn’t really working…

extends VideoStreamPlayer

func _process(delta: float) -> void:
	if not is_playing() and globalvars.openingcutsceneplay:
		play()
func _on_video_stream_player_finished() -> void:
	get_tree().change_scene_to_file('res://aftercutscenelevel.tscn')
	globalvars.openingcutsceneplay = false
	globalvars.iscutsceneplaying = false
	print("Finished!")
	stop()

Only thing that works is play(), the rest doesnt! I feel like this fix is right in-front of my eyes but I don’t know what, also the other thing is it loops without loop being true!

What isn’t working? Is it just not doing the end of the code? Is the signal connected correctly?

Note that change_scene_to_file removes the root of the scene from the tree immediately, so not all code might work as the node is isolated

yes. well maybe no… i dont really know how signals work because im pretty new after coming back to godot so i dont really understand how it works too well except through the docs and tutorials.. the _on_video_steam_player_finished() function isnt working, and i’m pretty sure its because it loops! its pretty weird though because loops arent enabled and even print(“Finished!”) doesnt work… any suggestions?

new code:

extends VideoStreamPlayer

func _process(delta: float) -> void:
	if not is_playing() and globalvars.openingcutsceneplay:
		play()
func _on_video_stream_player_finished() -> void:
	globalvars.openingcutsceneplay = false
	globalvars.iscutsceneplaying = false
	print("Finished!")
	stop()
	get_tree().change_scene_to_file('res://aftercutscenelevel.tscn')

still doesnt fix it, tho

See this, is the signal connected correctly?

AHHH DUDE THAT ACTUALLY HELPED SO MUCH I WAS USING THE WRONG FUNCTION I WAS SUPPOSTED TO US _on_finished LOL