Skip to content

spatial_audio_2d and spatial_audio_3d examples: emitter jumps when movement is unpaused #15837

@rparrett

Description

@rparrett

Bevy version

0.14, main

What you did

  • git checkout 754194fd24b7baaa24fcadca0b1378413e39421b
    (example is broken for other reasons in more recent commits)
  • cargo run --example spatial_audio_2d
  • Press space to pause emitter movement
  • Wait one second
  • Press space again to unpause

What went wrong

Emitter jumps in space rather than continuing from pre-pause position

Additional info

The arrow keys should still be able to move the listeners while the emitter movement is paused, so I'm not sure if we can just pause Time.

I would suggest a change starting from

 #[derive(Component, Default)]
 struct Emitter {
-    stopped: bool,
+    stopwatch: Stopwatch,
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AudioSounds playback and modificationC-ExamplesAn addition or correction to our examplesD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions