Przeglądaj źródła

Merge pull request #38524 from hoontee/master

Fix bug with AudioStreamPlayer3D audio position
Rémi Verschelde 5 lat temu
rodzic
commit
49a1e3db12
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      scene/3d/audio_stream_player_3d.cpp

+ 5 - 0
scene/3d/audio_stream_player_3d.cpp

@@ -710,6 +710,11 @@ float AudioStreamPlayer3D::get_pitch_scale() const {
 
 void AudioStreamPlayer3D::play(float p_from_pos) {
 
+	if (!is_playing()) {
+		// Reset the prev_output_count if the stream is stopped
+		prev_output_count = 0;
+	}
+
 	if (stream_playback.is_valid()) {
 		active = true;
 		setplay = p_from_pos;