diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 8aaa230075e..c1a40a817d9 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -253,6 +253,9 @@ bool AudioStreamPlayer2D::is_playing() const { } float AudioStreamPlayer2D::get_playback_position() { + if (setplay.get() >= 0) { + return setplay.get(); // play() has been called this frame, but no playback exists just yet. + } return internal->get_playback_position(); } diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index eb75650399d..19d241c8fa1 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -582,6 +582,9 @@ bool AudioStreamPlayer3D::is_playing() const { } float AudioStreamPlayer3D::get_playback_position() { + if (setplay.get() >= 0) { + return setplay.get(); // play() has been called this frame, but no playback exists just yet. + } return internal->get_playback_position(); }