Ok, sorry for trying to beat a dead horse here… but… is there a way to implement all this inside the widget itself???
Hear me out… this music should only ever play inside the MainMenu. When it’s loaded it starts… let’s the user play with the buttons, sliders etc etc, but as soon as the widget is closed… the music should be gone.
Having it in the PC is not only messy, but seems overkill to me.
Also, if I have to call the MainMenu ever again, let’s say on pressing ‘Esc’ key… I have to do all this all over again. (One of the reasons, I wanted it to be in a function to begin with.)
In the MainMenu widget I noticed there’s a “Play Sound 2D” (Plays a sound directly with no attenuation, perfect for UI sounds.)
Would it be possible to incorporate all this functionality using that, so there’s no need to communicate/delegate/dispatch anything else??? Everything happens in that widget?
It seems more intuitive to me since this music belongs to that widget.
And instead of BeginPlay, maybe it could be hooked on Event Construct??? just a thought…
Let me know what you think…
Or is this just bad practice? Any guidance is greatly appreciated.