Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FelicePollano |
Please have a look at my teleporter code:
func _process(delta: float) -> void:
if (player.transform.origin-transform.origin).length_squared()<20:
player.set_process(false)
if not $AudioStreamPlayer.playing:
$AudioStreamPlayer.play()
#yield($AudioStreamPlayer,"finished")
get_tree().change_scene(dest_scene)
notice the commented #yield, if i left it it apparently hangs. What I’ve tried is to play the sound and then when finished I wan to to change scene. I think issue can be related with having the yield in the process, and had call to set_process(false) but not sure, not sure how coroutine works in this case
I tried to replicate your setup but it works fine (Godot 3.5.1), have you changed any of the properties of the AudioStreamPlayer or tried with a different audio file / stream? And does it crash if you connect the finished
signal to a separate function and run the scene change there?
a_world_of_madness | 2023-01-08 20:06