Spatial 2D sound using SamplePlayer2D - bugs or bad arrangement?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vtepe
:warning: Old Version Published before Godot 3 was released.

Issue description on github

Making sound for the first time and honestly i do not know if i do it right. I place the SamplePlayer2D node as an indirect child of viewport and all the features appear bugged. I’ve described more on github and included minimal example… am i doing it right?

Github example works fine when SamplePlayer2D is not a child of a Viewport node.

vtepe | 2017-05-19 11:43

If you are making sound for the first time I bet what you need is SamplePlayer and not SamplePlayer2D.

Freeman | 2017-05-22 23:21

Why? It is a feature of the engine and should be similarly complex to place this node or that node depending on the need. Made a workaround: created SoundPlayer2D nodes as children of a separate path beside a Viewport / Camera2D path and now i have spatial 2D sound i needed.

EDIT: tricky part was positioning. Root viewport doesn’t move so have to place sound nodes relative to root viewport same as the owner objects are relative to camera. Tried making SoundPlayer2D nodes children of Node2D and positioning just one node but no effect. So had to position every SoundPlayer2D via script.

EDIT2: tutorials on using 2D sound properly are non-existent. Had to guess and hit what i assume was a bug.

vtepe | 2017-05-23 00:40