Protecting AudioComponent

Checking if we have an audio component (if (!AudioComponent) {return;}) every time we try to use one seems a bit redundant since we have already created a function to check for one as soon as we press play. Is there a way within the FindAudioComponent function to exit the program? If there is, would it be equal to or better than checking for one every time we try to use the component?

Thanks.

There are assertion macros you can use. Some are disabled in a non-editor builds

Asserts | Unreal Engine Documentation

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms