Ambient music stopping after item is picked up
I got my level working, the clearing up the lagoon one? Posted the other day, nevermind :)
Anyway, when the player picks up an item (bottle, tire, barrel) the ambient sound stops.
My music is set up so when the player leaves the water they hit a trigger box which starts a tropical beach ambience, then when they reenter the water the tropical ambience fades away and they hit another trigger box underwater, this starts the underwater ambience.
The problem occurs when the player picks up an item it triggers the EndOverlap event like they've left the trigger box, but I don't understand why? I think it's something to do with the 'pick up' event cancelling it out but I'm unsure how to fix it.
Any help would be greatly appreciated :)
P.s If you need other screenshots of my Blueprint just ask
asked Jun 21 '16 at 08:00 PM in Blueprint Scripting
The problem is that the red overlap triggers there will fire when -any- Actors enter or leave those volumes. What you want to do instead is test those blue "Other Actor" pins first and only let your players have an effect on those audio components. To do that, drag a wire off of the blue Other Actor pin and type "Cast To" and choose whatever one matches whatever your player class is. This node will have two execution pins, connect the top one to Fade Out node and leave the Cast Failed one hanging empty. Make sure to connect the front pin back to the red OnActorBeginOverlap node.
That way, let's say you shoot a bullet in the water. Red pin says "yo, somebody entered me" - the next node says "was it a player?" - nope it was a bullet and nothing bad happens. But if you jump in the water itself the red pin says "yikes, here comes another actor" - the next node says "was it a player?" - yes, okay lets play some underwater ambient now.
answered Jun 21 '16 at 09:43 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here