Topic was automatically imported from the old Question2Answer platform.
Asked By
tobycat
How do I make it so every button under my control node automatically plays a sound when hovered over, without connecting every single signal?
I have a control, under that is a Container, then my 4 buttons. I already have a function for instancing new sounds, i just need a way to make a sound play when hovering over them without having to connect signals to every one.
How about you make the button a scene. Then you just add a single script to the button scene and you can instance it however many times you need without reconnecting any signals every time.
I found a solution to this! I think it’s pretty alright.
The only problem I may have is, if I want to put anything else under that container, I’ll have to change the code a bit to check if a button. For now though, it works great.