So I have set up a inventory system, and I am having some problems setting a audio cue to play.
It plays audio when I click the key but the problem is if I have 2 different items with two different sound cue’s it will only play one were as if I only have on in my inventory at one time it plays the correct audio cue, obviousness I want to be able to have mulitpule items in my inventory and the correct audio files to play when i click the corresponding item.
I can’t tell from your implementation/screenshot how your audio references are actually setup, but you need to have a different USoundBase* ptr for each sound you want for each inventory slot. You are correct that probably don’t need to use an audio component (i.e. your PlaySoundAtLocation call is probably ok). Inventory sounds are usually 2D so you might not need to use PlaySoundAtLocation and instead use the 2D version of the PlaySound BP function.
hi sorry, this screenshot is on my Struct ( Screenshot - 04a8b6aec8eaee44bce2215b3d95bcb9 - Gyazo )
In my struct I tried changing the sound to sound base but when I did that it would play sound but would have the original problem of playing the same sound.
And this one is of how I am referencing them in ( Screenshot - 4ea6842ff62b46c5abe4b53688a9121a - Gyazo )
Again, hard to tell from looking at the screenshots. The audio stuff looks ok (I think) but to separate it out from an audio issue vs. some other implementation issue, put breakpoints on the PlaySound BP function and/or add print statements in your BP implementation to make sure that things are happening like you think they are. It could be that your event is triggering incorrectly or maybe triggering a bunch of sounds at once but you have a concurrency setting that limits to 1 at a time and only the first one is playing, etc. There’s as ton of things that could go wrong. You can also use “stat soundwaves” or some other console command to analyze what’s happening with the sounds, etc.
Did you ever figure this out ? I have a similar issue with some quest answer sounds , where if I have one answer in the data table it plays fine , but if I add more than one answer , then it always plays the last answer sound , even if I click the first answer , (or actually I think it is playing both answer sounds in order but I can only hear the last one ). where one pic is answer struct and other is code playing “answer sound”
Hi Razmaz51, you should strongly consider opening new support tickets vs reviving a 4 year old post! It’s cool to ref a link this post if you need.
Have you debugged this to confirm all the sounds are played?
Could add some debug breakpoints in the script, add prints, and use audio stat-commands to see if sounds are actually triggering (e.g. stat soundwaves, stat sounds, etc).