Play spatial sound from widgets inside widget component?

Is there a simple way to do this? Is there a way at all? I would have to know the widget component (or better the world location of the widget itself) from a contained widget when playing a clicked/hovered sound. It wouldn’t be right if you operate a widget component based console in the game and it placed 2D sounds directly in your head.

So, basically I would have to use an actor/component reference inside the widget blueprint and set it from the actor with the widget component containing the widget on creation? I could do that, but it would be cleaner if you could simply get the widget component (if any) from any given widget or its parent hierarchy.

could you just create an actor bp, add the widget and the sound as a component and trigger the audio play from the widget to play the audio from the BP? This would be a 3d sound which you can place in the world where you want it

Maybe I’ve missunderstood you, but you could add a variable of type audioComponent Ref to your widgetBP and expose that on spawn. Then set it from your actorBP which includes a widget component and the audio and wire that up. in your widgetBP you could trigger the Play of the audio after a button is pressed.
You could also work with event dispatchers, but I guess this would be a easy solution:

Yes, that’s what I was thinking of. It’s not very clean or flexible though. It requires a user defined 1:1 relation between a user widget instance and a widget component, when the engine should be able to provide this info via some function call. It’s like keeping an additional actor pointer in each component. And since there is already a system for button sounds in place, it should be fully “compatible” with 3D widget components as well. If I have to do it myself, I think I’d rather try to go all the way and get the world location of the sub-widget (like a button). There must be some way to do this with widget-space to world-space conversion.