# How can I bind a function to AnimInstance-\>OnMontageEnd?

**URL:** <https://forums.unrealengine.com/t/how-can-i-bind-a-function-to-animinstance-onmontageend/290717>\
**Category:** Character & Animation\
**Tags:** unreal-engine, delegates, question\
**Created:** [August 11, 2014, 7:24pm UTC](https://forums.unrealengine.com/t/how-can-i-bind-a-function-to-animinstance-onmontageend/290717 "2014-08-11T19:24:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anon26705860](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon26705860](https://forums.unrealengine.com/u/anon26705860)\
**Post date:** [August 21, 2014, 10:27pm UTC](https://forums.unrealengine.com/t/how-can-i-bind-a-function-to-animinstance-onmontageend/290717/2 "2014-08-21T22:27:36Z")

</div>

// Function declaration in header  
void OnAnimationEnded(UAnimMontage\* Montage, bool bInterrupted);

```
// In implementation
// Declare delegate
FOnMontageEnded EndDelegate;
 // Bind it
EndDelegate.BindUObject(this, &UMyClass::OnAnimationEnded);
//Set it
MyAnimInstance->Montage_SetEndDelegate(EndDelegate);

```

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-bind-a-function-to-animinstance-onmontageend/290717)._
