varying sound in interaction blueprint door/drawers

Didn’t watch the tutorial, but: just add an audio component to your Door/Drawer blueprint and Activate/Play it when they start moving/rotating.

If you’re not using Door/Drawer BP, but do everything in the Level BP, add an Audio actor to the level there the door/drawer is and Play/Activate it the same.

Or you can use the Play Sound at Location node not to use audio actors/components.

Make sure you untick the Auto Activate box in the sound details.

Hello,
following this video:

I made a Blueprint that I can pull into the level and then add doors or drawers that can be opened using linetrace.
Unfortunately I searched several videos and tutorials but none of them mentions how to apply the sound of the drawer or door to it.
Might be something totally easy, but I really am having difficulties finding out. Where and how would I add it in the blueprint?
If someone could explain it would be nice.
Greetings

You don’t need a sound variable. Click on the audio component and select the needed sound or cue in the details, it’s empty by default. Then you’ll be able to play it.

Thank you for answering,
I added an audio in components and added a sound variable in variables, but I don’t know if I chose the right option, but wherever I placed it with play sound activate sound, it didn’t work.

I upload a picture, of the blueprint I made from the tutorial the way it originally was.
(took the sound nodes out again because they didn’t work).

The variable I need because otherwise I there is no sound slot where I can pull in any wanted fitting sound, just like the door/drawer slot(or whatever it is called), as I understood it, but its possible I am mistaken)

But thank you anyway, I don’t want to stress your patience too much, I will just stick to the normal door blueprints for the time, hoping to find another tutorial, I am no programmer at all.
Thank you for your time :slight_smile:

Oh, you have the same blueprint for door and drawer? Just add a second audio component, it will be easier than changing the sound in only one.

You just Add Component again or simply duplicate the one you already have.

But actually, you don’t need that. Just go to the Construction Script, drag the Audio from the components list into the graph and I believe the needed node is called Set Sound or something similar to that. Just drag a pin off the Audio and find that node in the list. Then set the needed sound depending on if the actor is a door or a drawer.

Moreover, another tip: as I can see, you have all your variables exposed, so you must set the mesh manually each time you add the actor to the level. In fact, you can only leave Move and Closed variables exposed, and add the functions to set the mesh and the location/rotation in the same construction script; thus you’ll only have to click on Move, and the Door and Drawer will change automatically in the Viewport for you. I’ll be able to show you some screenshots in maybe about 4 hours or so, if you need them.

Another thing, you’ll probably want your opening and close sounds to be a bit different. As for me, if you simply change the pitch of the sound by 5-10%, it sounds quite good. Let’s say, when you open the drawer, the pitch is 1, but when you close it, it’s 0.9 or 0.95. And you can use one and the same audio component and the same sound/cue, but you’ll have to change the pitch before every action.

Edit: if you want to add some more options to the BP, not to be just a door or a drawer, but 3 or more different objects, I suggest you looked into creating an Enum with names of all desired objects. Thus you’ll be able to select them from the dropdown list, which is much more informative, and use Switch on Enum to perform all the required functions instead of setting a bunch of If Branches.

Hello,
yes, it is one blueprint for all. The way it works: the blueprint itself is just holding a default cube when put into the world, which I can then change into any model.
I can choose if I want it to rotate or move, how much it rotates or moves in the defined direction.
This way I can use this same blueprints for different objects attached to it without having to make a blueprint for the door or drawer itself. That is why I like it.
If I now could add a thingy, into which I could also drag in any sound I need, it would be just perfect.
I didn’t understand how/where you mean adding a second audio-component?

Hello,
thank you very much for your bother to look into this further.
I didn’t really have the will to work with it though today, too much logic, my brain is taking it’s time off.
But I will again tomorrow or later this evening and let you know if it worked :slight_smile:

Hello,
I finally could get it to work:

“Moreover, another tip: as I can see, you have all your variables exposed, so you must set the mesh manually each time you add the actor to the level. In fact, you can only leave Move and Closed variables exposed, and add the functions to set the mesh and the location/rotation in the same construction script; thus you’ll only have to click on Move, and the Door and Drawer will change automatically in the Viewport for you.”

By exposes you mean the eye-editable thingy? If so, I will leave it, because I don’t want to use it for drawers and doors only, I will also want to slide other things, like books, notes, and more. So I need to be able to add anything.

"Edit: if you want to add some more options to the BP, not to be just a door or a drawer, but 3 or more different objects, I suggest you looked into creating an Enum with names of all desired objects. "

I probably would, if I wouldn’t have so much difficulties understanding Blueprints. I better not touch it anymore now that it finallyworks.

Greetings