RealDocs

UAudioComponent::OnAudioPlayStateChanged

property Engine Blueprint Since unknown
#include "Components/AudioComponent.h"
Access: public Specifiers: UPROPERTYBlueprintAssignable

Description

Broadcasts whenever this component's play state transitions between Playing, Stopped, Paused, FadingIn, and FadingOut.

Caveats & Gotchas

  • Fires for every state transition, including ones triggered internally by fade curves completing — check the PlayState parameter rather than assuming the delegate implies one specific transition.
  • Non-UObject C++ listeners should bind to the shadow OnAudioPlayStateChangedNative delegate instead; the BlueprintAssignable delegate can only be bound from Blueprint or UObject-derived classes.

Signature

FOnAudioPlayStateChanged OnAudioPlayStateChanged

Example

React to play state changes C++
AudioComp->OnAudioPlayStateChangedNative.AddLambda([](const UAudioComponent* Comp, EAudioComponentPlayState State)
{
    if (State == EAudioComponentPlayState::FadingOut)
    {
        UE_LOG(LogTemp, Log, TEXT("Sound fading out"));
    }
});

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.