x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

varying sound in interaction blueprint door/drawers

Hello, following this video: https://www.youtube.com/watch?v=nNxKRYrNLkA 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

Product Version: UE 4.21
Tags:
more ▼

asked Jan 09 '19 at 09:11 AM in Blueprint Scripting

avatar image

Smina
21 1

(comments are locked)
10|2000 characters needed characters left

6 answers: sort voted first

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.

more ▼

answered Jan 09 '19 at 09:25 AM

avatar image

Tuerer
1.7k 11 6 8

(comments are locked)
10|2000 characters needed characters left

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. alt textI 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).

interactbp.png (401.5 kB)
more ▼

answered Jan 09 '19 at 11:08 AM

avatar image

Smina
21 1

avatar image Tuerer Jan 09 '19 at 11:11 AM

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.

(comments are locked)
10|2000 characters needed characters left

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) alt text 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 :)

more ▼

answered Jan 09 '19 at 03:27 PM

avatar image

Smina
21 1

avatar image Tuerer Jan 09 '19 at 04:36 PM

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.

(comments are locked)
10|2000 characters needed characters left

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?

more ▼

answered Jan 10 '19 at 11:00 AM

avatar image

Smina
21 1

avatar image Tuerer Jan 10 '19 at 11:49 AM

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.

(comments are locked)
10|2000 characters needed characters left

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 :)

more ▼

answered Jan 10 '19 at 03:55 PM

avatar image

Smina
21 1

(comments are locked)
10|2000 characters needed characters left

Hello, I finally could get it to work: alt text

"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

sound-door.png (495.9 kB)
more ▼

answered Jan 12 '19 at 02:58 PM

avatar image

Smina
21 1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question