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"

How can I ensure a trigger volume only plays a sound once?

Excuse me, I'm pretty new to UE4, but i'm working on a Games Sound project for University.

I have trigger volumes that are playing audio that are located within events in FMOD Studio, however I want the sound to trigger once and once only within one play through.

My blueprint is simply an OnActorBeginOverlap linked to a PlayFmodSound (which references my fmod sound event).

Seems simple in theory, but I can't quite suss it out. Any help would be greatly appreciated.

Product Version: UE 4.16
Tags:
more ▼

asked Dec 08 '17 at 12:19 PM in Blueprint Scripting

avatar image

ChickenGuzan
1 1 2 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Use the node 'DoOnce' and plug it in before your PlaySound.

alt text

Please note that the 'ResetMyThing' Event is optional, and you do not need to use it. However this would allow you to reset this circuit and have your Sound Play again.

For example: Player opens door, the Sound plays, but cannot be played again.

When the Player closes the door the Reset Event is called, and for the next door opening the sound would play again!

unbenannt.png (79.4 kB)
more ▼

answered Dec 08 '17 at 01:15 PM

avatar image

Heidi
111 3 6 7

avatar image Evil_Fischi Dec 08 '17 at 01:40 PM

oh nice, didn't know that that existed, now I have learned something new, tanks ;)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

insert a branch after begin overlap and use a boolean variable. Use the false exe to play your sound and then set the variable to true. So on default the variable will be false, the branch will run the false execute and on the next overlapt the branch condition will be true and nothing will happen

Cheers Evil_Fischi ;)

more ▼

answered Dec 08 '17 at 12:37 PM

avatar image

Evil_Fischi
287 8 14 20

avatar image ChickenGuzan Dec 08 '17 at 12:50 PM

Thanks for getting to me to so quick.

I'm with you, however i'm not 100 percent sure about the variable... This is what I've got so far? I inserted the branch as you mentioned.

alt text

sketch-01.png (41.1 kB)
avatar image Evil_Fischi Dec 08 '17 at 12:56 PM

you are nearly there!! Now you just need to create a variable and plug it in the branch. Check out the documentation about variables: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Variables/

avatar image ChickenGuzan Dec 08 '17 at 01:06 PM

So I've made a variable and just named it stop. Do I hook the variable up to the condition ext? Or do I hook a set-variable object to the true ext? Neither seems to work, but i'm 100 percent blaming my newby approach.. Thanks Again!

avatar image Evil_Fischi Dec 08 '17 at 01:16 PM

The branch note is an equalent to an IF so you want to check something. You check if your variable is true or false. When do you want your sound to play or when do you don't want it to play? -You want it to only play once. So you want to set your "stop" to true when the sound was played the first time.... (I asume that you are not that much familiar with programming, so I will only point you to the right direction, but you need to do the last step ;) )

avatar image ChickenGuzan Dec 08 '17 at 01:33 PM

A wild guess... Haha!

alt text

sketch-02.png (103.0 kB)
avatar image Evil_Fischi Dec 08 '17 at 01:44 PM

This would have been the right answer:alt text

unbenannt.jpg (50.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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