OK so I have 2 blueprint items, let’s say a sword and a shield, when the character overlaps the sword a sound plays and then the item is attached to a hand socket. Works great, now when I overlap with my shield, which is set up the same way the sound from the Sword plays again plus the sound from the shield pickup. When I run around both sounds start playing constantly, I think both items are constantly colliding at this point causing the sounds to play non stop. Here is how the bp looks.
The shield BP is setup exactly the same (except the last 2 nodes displaying an icon on screen) also the socket is attached to the back not the hand.
I also have some bushes in game that plays a sound when you run through them, when you have either the sword or shield item, those sounds start playing as well.
Anyone know how to correct this so the sound from the sword and shield only play 1 time on pickup and never again?
ok So I think I may have found a work around, I deleted the sound from the blueprint items, and then put a trigger box around the item, and when the player overlaps the sword they also overlap the invisible trigger box, the trigger box plays the proper sound then destroys itself (the triggerbox).
So it seems my work around does not work like I thought.
I wrapped my sword in the trigger box (the triggerbox is OnPlayerBeginOverlap > Play 2D Sound > Destroy Actor)
Removed the sound from the sword BP so it would only play the triggerbox sound
When I went in game it worked but when I ran over the other item no sound plays.
I think what happens is, once one “ActorIsDestroyed” happens it makes the other trigger boxes not work anymore.
Anyone know what to do?
Simple fix would be to add a boolean, “Has Played”. Only play if it is false, and when you play, set it to true.
Another idea would be to add a Do Once node at the start.
Perfect, I had no idea about the “Do Once” node
Set the Trigger boxes to "OnOverlap > Do Once > Sound
Many thanks! I knew it would be simple just didn’t think that simple.