godot icon indicating copy to clipboard operation
godot copied to clipboard

AudioStreamPlayer2D Doesn't Move Proportional to Parent ParallaxLayer

Open directrix1 opened this issue 1 year ago • 3 comments

Godot version

4.1

System information

Godot v4.1.stable - Arch Linux #1 SMP PREEMPT_DYNAMIC Sat, 10 Jun 2023 00:35:35 +0000 - Vulkan (Compatibility) - AMD Radeon RX 7900 XT (gfx1100, LLVM 16.0.0, DRM 3.52, 6.3.7-arch1-1) () - AMD Ryzen 9 3950X 16-Core Processor (32 Threads)

Issue description

I have an AudioStreamPlayer2D as a child node of a background element. The background element, being on a ParallaxLayer, moves at a small fraction of the camera's (and AudioListener2D's) movements. Unfortunately, the AudioStreamPlayer does not honor this fractional moving so it does not stay aligned with the background element.

Steps to reproduce

Put AudioStreamPlayer2D on parallax background with some graphic and make the layer move at some small fraction of the distance as the camera with the AudioListener2D. Move the camera and AudioListener2D. The visual object will still be on the screen but the AudioStreamPlayer2D will be inaudible with a great enough distance.

Minimal reproduction project

AudioStreamPlayer2D Bug.zip

directrix1 avatar Jul 11 '23 06:07 directrix1

I doubt this is intended to work in the first place. I'd probably document the limitation in the meantime.

Calinou avatar Jul 11 '23 14:07 Calinou

Yeah, I'm sure it is just an unforeseen consequence of how the parallax layers work (and how nobody really thought to consider AudioStreamPlayer2D interaction with it), but I would imagine expected behavior would be for an AudioStreamPlayer2D placed on a background element to always sound like it's coming from that background element. Not a big deal in my particular case, and I'm working around it. I just thought I would report it.

directrix1 avatar Jul 12 '23 00:07 directrix1

I just encountered this same issue on my own, been driving me crazy trying to figure out what was going on.

Running 4.1.3 stable

rannsaka avatar May 14 '24 19:05 rannsaka

I suggest testing the new Parallax2D node in 4.3.dev6 (make a backup of your project before upgrading). It may address the issue outlined here.

Calinou avatar May 15 '24 23:05 Calinou

Just tested the MRP converting to Parallax2D and works as expected. CanvasLayer strikes again!

markdibarry avatar Aug 28 '24 14:08 markdibarry