Adding music to a room

Hello all! I need some serious help. I am currently trying to add music to ONLY safe room. I have followed 3 different tutorials step by step and no matter what I do NOTHING works. The music plays all over the map. Regardless of trigger box and everything. It even overlaps another sound cue that I have outside. Would anyone be able to help me out and let me know what it is that I am doing wrong? It seem’s like such a simple task. Everyone online did it no problems, but for me it is just not working how it should.

begin overlap > create sound > promote to variable > play
end overlap > get variable > destroy actor/component

Same for the other overlapping cue.

OR

you place both sounds on the map with an Attenuation distance ( box. sphere,capsule ) what ever you need, make them overlap together a little bit so it kinda have a fading effect. Depending on what fits the most.

Thanks so much, going to try both of these now. Hopefully something works. Will keep you updated.

If you cant get it to work, i might build you an example map so you can check it out. But not today i guess

I’m not sure why I acted like I knew what you were talking about lol. I am VERY new to unreal engine, so this is what I could muster from that explanation unfortunately. Still pretty lost.

on “create sound 2d” right click on the right blue dot and select “promote to variable”, name it like you want. then on the promoted variable node, drag to blue one inside the play node.

I dont know what the “get console variable int value” is for, but you can delete it. instead, copy the just created varialbe, plug it in there instead, and this time from the variable, drag to blue out again and look for “destroy component” ( i think this is what its called on this)

Also make sure that your player character and your trigger box has “multi overlap” activated, just to get sure.

Try copy that if it works. I dont think you need another branch on the " end overlap" event, because i assume only your player will enter and leave it

btw ignore my events, these are just for demonstration purposes. Just use yours

My apologies. I truly am trying my best. Sorry to be annoying but I’m just not familiar enough to do certain things.

This is what I could muster.

These are the problems I had. I’m not sure what this is.

Your play says media player, mines says audio component

and the variable wont connect

Ok at first, on the left side there should be a variable, called new var 0. Drag this into event graph, and select “get” not “set”, and you put this directly into the destroy node.
Then you delete the play media node, instead drag out the blue from the variable like in your screnshoot, let go und search for “play”, it should automaticly find what it fits for. IF and only IF you find for some reason more, check if in the new opened window, the checkbox is checked.

the branch thing is called “equal”, drag the blue pin out from the get player character and type in “equal”
then from the “begin overlap event” ( red one ) drag out “overlapped actor” and put this to the other slot in the “equal” node

To the left of what? I’m sorry man I am just not that familiar with unreal engine. Is there any possible way we can do a quick discord chat with screen sharing so you can show me what you are talking about? This is unfortunately the only way I can learn. Trying to comprehend what you don’t understand is nearly impossible. :frowning:

I know how your feeling dont worry, i also need everything visual to learn. But im currently busy so i dont know when i can send you some screenshots

Thank you for understanding. Whenever you are free please let me know. I will be around.

Here is some early footage of everything I’ve done so far up to this point.

https://drive.google.com/file/d/1BbdlJAtojtFFKS3sv01fQF8_DA61knZO/view?usp=sharing

updated piano puzzle riddle
https://drive.google.com/file/d/17SkdpMRitGMtT9yyUQnPYqOe48eK5kLX/view?usp=sharing

I can try to explain SassiX’s solution a little simpler. Let’s take this one event at a time. Since you seem to be new to scripting, we can help you learn some basics that should speed up your workflow.

Firstly.

https://i.imgur.com/iH90rqK.png

This wonderful thing is what I like to call a comparator (think minecraft). It take’s two inputs and decides if A is equal to B or not. (I believe this works Visa Versa as well). You can get to it be Right Clicking anywhere in your Blueprint editor and typing “==” into the search bar. OR, you can drag off any boolean (red) pin from a node that has it and type “==” as well.

Second, the reason why your Audio file pin and the Play pin are not connecting, is because they are of different types. Like SassiX said, you have a Media Player component. You want the Audio Component. A quick and ez fix for this is just simply click and drag from the pin on the new variable you made and in its search box, type: “Play”.

This is a good habit to get into , as unreal has a lot of context sensitive functions, and providing the context (dragging from a pin/variable/etc) before you look for a function will help you save plenty of time in the long run.

Wow thanks so much! this helped a ton!