Hey,
I wonder how to solve that best:
- I've a scene with an AudioStreamPlayer2D which starts the sound playback in
_ready(): - I instantiate this scene via instantiate()/add_child()
- I assign the
global_position
⚠ Problem: The sound is NOT hearable if you're not close to [0,0]! Because the sound started playing as soon as it entered the scene and thus, it did not have it's position assigned yet since this command comes AFTER add_Child(). Assigning it before results in errors like can_process: Condition "!is_inside_tree()" is true. Returning: false
How do you solve this? Wait for 1 frame before playing the sound so that the position gets updated? Playing the sound in _process():instead of _ready():? ...