UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PlayMontageCallbackProxy.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6#include "UObject/Object.h"
9#include "PlayMontageCallbackProxy.generated.h"
10
12
13UCLASS(MinimalAPI)
15{
17
18 // Called when Montage finished playing and wasn't interrupted
19 UPROPERTY(BlueprintAssignable)
20 FOnMontagePlayDelegate OnCompleted;
21
22 // Called when Montage starts blending out and is not interrupted
23 UPROPERTY(BlueprintAssignable)
24 FOnMontagePlayDelegate OnBlendOut;
25
26 // Called when Montage has been interrupted (or failed to play)
27 UPROPERTY(BlueprintAssignable)
28 FOnMontagePlayDelegate OnInterrupted;
29
30 UPROPERTY(BlueprintAssignable)
31 FOnMontagePlayDelegate OnNotifyBegin;
32
33 UPROPERTY(BlueprintAssignable)
34 FOnMontagePlayDelegate OnNotifyEnd;
35
36 // Called to perform the query internally
37 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true"))
38 static ANIMGRAPHRUNTIME_API UPlayMontageCallbackProxy* CreateProxyObjectForPlayMontage(
39 class USkeletalMeshComponent* InSkeletalMeshComponent,
41 float PlayRate = 1.f,
42 float StartingPosition = 0.f,
44 bool bShouldStopAllMontages = true);
45
46public:
47 //~ Begin UObject Interface
48 ANIMGRAPHRUNTIME_API virtual void BeginDestroy() override;
49 //~ End UObject Interface
50
51protected:
52 UFUNCTION()
53 ANIMGRAPHRUNTIME_API void OnMontageBlendingOut(UAnimMontage* Montage, bool bInterrupted);
54
55 UFUNCTION()
56 ANIMGRAPHRUNTIME_API void OnMontageEnded(UAnimMontage* Montage, bool bInterrupted);
57
58 UFUNCTION()
60
61 UFUNCTION()
63
64private:
65 TWeakObjectPtr<UAnimInstance> AnimInstancePtr;
66 int32 MontageInstanceID;
67 uint32 bInterruptedCalledBeforeBlendingOut : 1;
68
70 void UnbindDelegates();
71
72 FOnMontageBlendingOutStarted BlendingOutDelegate;
73 FOnMontageEnded MontageEndedDelegate;
74
75protected:
76 // Attempts to play a montage with the specified settings. Returns whether it started or not.
77 ANIMGRAPHRUNTIME_API bool PlayMontage(
78 class USkeletalMeshComponent* InSkeletalMeshComponent,
80 float PlayRate = 1.f,
81 float StartingPosition = 0.f,
83 bool bShouldStopAllMontages = true);
84};
UAnimMontage bool UAnimMontage UAnimMontage Montage
Definition AnimInstance.h:84
NotifyName
Definition AnimInstance.h:121
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type, Param1Name)
Definition DelegateCombinations.h:53
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition Object.h:95
Definition PlayMontageCallbackProxy.h:15
Definition AnimNotify.h:24
Definition WeakObjectPtrTemplates.h:25