Hi, I have made a level where once the game starts I want an audio track to start playing. I want the user to be able to toggle between 3 audio tracks when playing the game. I create a Soundtrack BP and inside I had the 1st track play when game starts, I connected EventBeginPlay to PlaySound2d node and chose the 1st song. That works fine, everytime the game starts the 1st track plays. I want the user to press the Keyboard letter 2 to play song 2, keyboard letter 3 to play song 3 and keyboard letter 4 to stop all audio, and of course when player presses 1-3 keys, I want it to first stop any audio that is currently playing first then play the correct song. I cant seem to do this in BP. What node can I use to stop all audio from playing. For example I choose Keyboard letter 1 in BP, then from output of that node I need all audio to stop playing, then from that node I input Playsound2d and choose 1st song. So it first stops all audio playing then 1st song plats. Any help would be great thanks
Hi
Instead of play sound, use spawn sound 2d. It gives you a reference, which you can use later to modify or stop the sound.
Thanks, so I add Spawn Sound 2d to add the sound, how do I stop the sound, what node do I need for that?
Drag off the reference you get from the spawn. âStopâ is one of the options
Sorry, I m not understanding. Here is my BP below. When Level starts I want the Arp_Bounce song to start playing. When player presses 1, I want the Arp Bounce sound to stop then I want the Hello MR song to start?
So What node do I need from 1 keyboard press
That will be because you havenât enable input on the blueprint. In the details, enable input for player 0.
( Details panel of the level BP ).
I tried this, please see below, I compiled and ran and it didnt work and I got a Blueprint Runtime Error : Blueprint Runtime Error: âAccessed None trying to read property NewVarâ. Node: Stop Graph: EventGraph Function: Execute Ubergraph Soundtracks Blueprint: Soundtracks
Ok, you just made the new variable ânew var 0â, so you have to use that here
thatâs why you made itâŚ
nice one, this worked, thanks again for your patience, very much appreciated.