I can't get mouse clicks sounds working while clicking buttons in a widget

So i’m trying to make this game where you control a PC. Now everything works fine, with widgets etc. but the main thing that i cant get to work are the sounds. So if i for example want to make mouse clicking sounds, or keyboard sounds, i just cant. I tried the following methods:

  • Using the player controller, i tried to add a sound everytime left mouse button was pressed.
  • Same thing with an actor placed in game.
  • Adding every single click sound on every single button. It’s working but very it’s inconvenient because i have many widgets.

That’s why you create a user widget first, script how it’s supposed to work, style it, make it pretty and audible. And only then use those widgets in place of buttons. Each user widget button becomes highly customisable.

So if i for example want to make mouse clicking sounds, or keyboard sounds

This could be done using overrides, onMouseDown and onKeyDown. Some widgets (like buttons) have it built-in (so to speak) but this functionality can be added to any widget.


What are you using to show the user they’re typing? An Editable Box?

To make mouse clicking and keyboard sounds work efficiently across your game without manually adding sounds to every widget, you can handle this at a global level using a few simple tricks:

  1. Player Controller Method: Instead of assigning sounds to every widget, handle sound playback in your Player Controller, which can track user input (mouse clicks, key presses) across the entire game. This way, whenever the player clicks or types, a sound will play automatically, no matter what widget or screen they are on.

  2. Custom button widget: Create a custom button widget that has the sound integrated into it. This way, you don’t need to manually add a sound to every button. Whenever you use this custom button in any widget, the sound will play on click automatically. This saves a ton of time.

  3. Event dispatcher for widgets: Set up an event dispatcher that triggers sounds globally when certain actions happen in your widgets (like clicking buttons or typing). This way, you avoid having to manually add sounds to every single button and instead handle it from a central location.

  4. Use UI sounds settings: Unreal Engine has built-in UI sound settings. You can assign sounds to default UI actions (like button clicks) through Project Settings → Engine → User Interface → UI Sounds. This way, button click sounds will automatically play without additional setup.

By using these methods, you’ll reduce the need to micromanage sounds on each widget and ensure a consistent audio experience across your game.

Yes, i’m using an editable box to show the user that they’re typing. In fact, everytime i try to type outside of anything that displays the text that you’re typing, the sounds work fine. Same with the mouse, if i type onto a button of the widget it doesn’t work, but anywhere else where there isn’t an actual interaction it does work.

It’s just this.


In short: when you interact with widgets you should let widgets handle the sound. The player controller does not know what is happening to the mouse / keyboard when widgets are in focus.

Attack to player dosen´t work Please, i need help.