Ivan3z
(Ivan3z)
March 19, 2024, 9:11pm
1
I have a problem in my project.
I have reproduced the problem in a new blank project.
These are the project files:
UISoundProblem.zip (13.2 MB)
The problem is a sound can not be played in a UI (more or less)
It does works when the player is shooting itself (see this video).
When shooting to other player. The event work, the amimation work, but the sound does not work.
I don’t want to replicate the audio. I just want the player to be the only one that can hear it when he get any damage.
How to fix it?
In this path are the files:
I made these changes to the code:
In BP_FirstPersonCharacter i added this (A Take Damage Rep_Notify):
In BP_FirstPersonProjectile i added this (Apply Damage):
In BP_Weapon_Component i added this (Spawn Projectile On Server):
I created a new HUD class (MyHUD) with this code:
I created a new UserWidget class (UI_PlaySoundWhenTakeDamage) with this code:
Any help is welcome!!
Thank you so much!!
Can you try to set “AllowBackgroundAudio” to true in the editor settings?
It is disabled by default - and I think that is why you are not hearing any sound (because the second PIE window has no user focus and thus is in the background)
Let me know if this fixes it
1 Like
Ivan3z
(Ivan3z)
March 20, 2024, 7:57pm
3
Hi @Featuriing
Unfortunately that didn’t solve the problem.
Thank you very much for your help.
Very appreciated
1 Like
Ivan3z
(Ivan3z)
March 20, 2024, 8:41pm
4
You are right about the focus and the sound.
When the PIE window is not focused, the sound is not heard.
I just did a test on my original project.
However, the option “Level Editor/Miscellaneous/Allow Background Audio” does nothing…
it seems to be broken… Maybe it’s a bug.
I have version UE5.3.2
It would be nice if someone else could confirm this.
I have been on the verge of madness for two days looking for a solution to this.
Thank you so much @Featuriing !!
1 Like
Ivan3z
(Ivan3z)
March 21, 2024, 7:44am
5
I reported the bug… i hope they can fix it soon
I opened a thread on the forum because the audio doesn’t seem to work in a specific situation.
You can see all details here:
A user gave me a solution:
ENABLE: “Level Editor/Miscellaneous/Allow Background Audio”
But that option doesn’t seem to work (See Video Attached Here).
I think the user is right, and seem that option doesn’t work like he says it should.
In any case i cannot test the audio correctly.
If it is a bug, please fix it.
And if you know a console command to enable …
Thank you so much for your help @Featuriing
1 Like
system
(system)
Closed
April 20, 2024, 7:44am
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.