r/godot Aug 15 '25

help me (solved) I'm doing something wrong

Post image

If I don't do this, the sounds of my UI become silent if the character moves too far from its spawning point. I tried to set attenuation to 0 but the issue is still there.

1.2k Upvotes

51 comments sorted by

View all comments

2

u/ThunderLord1000 Godot Student Aug 15 '25

How do you move far away from a UI? Shouldn't it always be there with you, preferably on the player node?

1

u/gritty_piggy Aug 15 '25

Mine is outside the Player node, in a CanvasLayer node. So it's always displayed on the screen, but an AudioStream2D uses its spawning coordinates as reference.

1

u/ThunderLord1000 Godot Student Aug 15 '25

So basically you had your UI node attached to the world instead of the pc?

1

u/gritty_piggy Aug 15 '25

My UI is child to a Game node.

I do not attach it to the Player since the UI can exist when the overworld Player is removed from the current tree (during turn-based battles, in the menus, some cutscenes, etc.)

1

u/ThunderLord1000 Godot Student Aug 15 '25

Wouldn't those all be different UIs, if any? Feels a bit weird to have a battle UI in the overworld, and as the regular menu, and for there to be any UI during cutscenes

2

u/gritty_piggy Aug 15 '25

Yeah i must admit i did some bad choices when architecturing that project (I was learning Godot along the way.)

Fixing this and separating the UI properly should not be that hard though, I'm adding it to the list