Hey, need help with some audio work, sample here.
I'm trying to use 3-D audio in 2-D by creating an invisible viewport with a camera and listener, then syncing any AudioStreamPlayer3D
nodes with Node2D
parents. I'm doing this because 2-D audio doesn't support a top-down perspective centered on the player, only on mid-screen. This almost works in that positions do update, and rotating does move sounds around the listener. But my sounds are off by 90 degrees, and I'm wondering if there's some difference in 2-D/3-D rotation that I'm not accounting for.
Specifically, my example creates a player at (0, 0) and a sound at (10, 0). The player's default rotation is 0, so I'd expect the sound to be in front. But instead, it is off to the right. Left/right-arrows rotate, and rotation sounds as it should, but the angle is off.
Further, if I comment out rotation, nothing changes. To me, this suggests a difference between 0 rotations in 2-D and 0 rotations in 3-D. So I don't think this is specifically an audio issue, but instead a matter of how I'm converting a 2-D object's global_rotation
to 3-D--I mean, I'm just setting it directly, but I'm wondering if I need to transform the rotation somehow before applying it to the 3-D stream.
Thanks for any help. Been banging my head on this one for weeks and don't know what to do.