"Await" freezing my project without an error

Godot Version

4.2

Quesion

I have AudioSteamPlayer in project. This must play after win and code is wait when finished sound and code change scene.
Breakpoint showing to code get await but await is freeze project.

func death(GoodEnd: bool, Version: String):
	if alive:
		alive = false
		if GoodEnd: # Work on win
			print(0)
			$End.play() # AudioSreamPlayer
			$Flash.visible = true
			print(1)
			await $End.finished # Breakpoint work
			print(2) # Project freezed
			Globals.Ending = Version
			get_tree().change_scene_to_file("res://Scenes/ending.tscn")
		else:
			Globals.Scream = Version
			get_tree().change_scene_to_file('res://Scenes/screamer.tscn')

P. S. Sorry if I make a mistakes is text. I just know English not very well.

Have you made sure that the “finished”-signal is getting emitted?

Yeah, I’m sure. All was nice before this case

Does the sound play?

Yes. Sound play but await stops project. I try to connect singal to script but this is not helped

Does the audiostreamplayer have a script attached to it?

I just move it to other scene. Stupid solution but this working…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.