Hi, I have created a trigger box. So in the beginning of the game there’s a music track -ambience- but then you go up some stairs and the music changes; when you leave that floor the music ambience keeps playing.
So this is my estructure
It seems to be ok because when you enter the trigger, the music changes, and when you leave the trigger, the music goes back. BUT I don’t know what I have done: when adding OnactorEndOverlap, everything messes up and the only song that I heard is the initial song. I mean, click on play: track A sounds, go up the stairs: it changes to track A (before creating OnactorEndOverlap overlap,it sounded music B), when going down the stairs, it changes to track A!
Let’s see here, according to your blueprint here’s how it will work:
On Begin play: Track A plays
On start overlap: Track B plays
On end overlap: Track A plays
Hi, thanks for replying. On begin play there’s ambience music, therefore Track A plays. On start overlap (I guess it’s when player enter the trigger) another track B plays. When player leaves the trigger track B ends and everything goes to normal, so track A plays (I don’t even care if track A starts from the beginning or not). That’s the behaviour but I don’t know, someone says I don’t need Set sound, but actually I learnt to do this by seeing this video
the problem of this video is that in the comments people ask how to stop the music when leaving the trigger box. But he uses Set sound. Other saying that I should use print spring. I’m so new to Blueprints that I’m learning almost by mimicking others
when the player goes up the stairs and arrives the upper floor (where there’s a trigger box) a second track starts. But the intention is just to sound on that floor. When the player goes down the stairs, the first track should play again. If the player does up again, then the track 2 plays again. It’s the behaviour of the trigger box. (That’s the intention)
As you see, the second track continues playing.
The blueprint is right now like this (i deleted on actor end overlap because I have to submit the sample, so I prefer having in this way than in the wrong way that I posted)
Make sure that “On Actor End Overlap” triggers correctly, by adding a test “print string” before set sound, or press F9 on Set Sound to add a break point (that will stop the game when that node is called, just to debug).
Add a Stop sound before setting the new Set sound, and add a Play node, just to try it out (you can refine Fade in afterwards)
But now:
1- when I arrive at the upper floor, it plays Track 1.
2- I leave the upper floor, and it plays Track 1 again.
3- But then, if I return to the upper floor, it doesn’t changes the track.
Maybe the ‘Do Once’ is causing an issue? Because before you told me the solution, Track 2 only played once and not every time I entered the trigger box.
I don’t know why track 2 doesn’t play if it is selected at 'on actor begin overlap (triggerbox).
I think when you have told me to add ‘stop’, it doesn’t know which track to stop, I mean from stop I have audio component > music player. It doesn’t reference the track 2.
Hi, thanks again, I’ve working on it and until now I haven’e been able to reply! One solution could be:
To add a Reset node to the Do Once when the flow exits the trigger (On Actor End Overlap). This way, I’d allow track 2 to play again when re-entering.
But I don’t understand well if I should reset On actor begin overlap AND On actor end overlap or just On actor end overlap.
Instead of using only Set Sound, I could also add the Stop and then Play nodes to force the music to update.
But I don’t know if I have to put Stop and Play at: On actor begin overlap AND On actor end overlap.