I’m trying to import audio component to an actor. I have added an audio property in the header file using the following piece of code:
Then in the .cpp file I have the following code:
MyAudio = CreateDefaultSubobject<UAudioComponent>(TEXT(“Audio”));
Right now I have the audio playing but since it’s a short audio file, it is just played once and then it stops.
I was wondering whether there is a way to play the audio in each frame using the existed “tick” function, then the sound is always played.