Help with Metasound in Unreal Engine 5

I’m currently working on a simple breathing sound system for an enemy AI. The system includes two wave players. One that plays a looping breathing sound and a second one (initially not playing) that’s supposed to play a growling sound when a trigger (PlayGrowl) is triggered through blueprints (this sound does not loop turned on).

My setup is simple, when I activate the PlayGrowl trigger in blueprints, I am setting the gain of my breathing sound from 1 to 0 (slowly fading it away) and then increasing the gain of my growl from 0 to 1 (slowly increasing the volume of the growl as it plays). My issue is that I want to automatically reset the gain of my breathing sound once the growl sound is finished. I tried to connect the On Finished pin of the growl wave player to the Reset pin of the Value node which is driving the value of the breathing gain, and then connecting the On reset to a Trigger Any node which is connected to the Play of the breathing wave player, but I get an error saying “connection causes loop”.

Not sure if I’m missing something or there’s a different way to achieve what I need.

Appreciate any help/support I get.

I have also attached an image of my metasound node setup.
FIrst image shows the connection I am trying to make (red line)


Did you figure this out? Trying to do something similar.

To avoid the ‘connection causes loop’ issue you need to connect the input to the ‘deffered getter’ for the variable instead of the variable itself and set the variable itself from the ‘is almost finished’ trigger instead of the ‘on finished’.

Basically due to the way metasounds work you cannot connect a variable to a node that’s upstream from it because the entire metasound is basically calculated ‘in one go’, so essentially nodes can’t feed into themselves, the ‘deffered getter’ option for a variable says ‘give me the value of this variable as it was at the end of the last audio frame’, incidentally, the ‘is almost finished’ trigger will file one audio frame before the wav is done playing, so combining the two you can get the behavior you’re looking for.

Using the ‘is almost finished’ trigger and the deferred/delayed getter is essential in order to loop sounds correctly in metasounds.