# Play animation in C++

**URL:** <https://forums.unrealengine.com/t/play-animation-in-c/537189>\
**Category:** C++\
**Tags:** unreal-engine, UE5-0, CPP, question\
**Created:** [April 23, 2022, 1:29am UTC](https://forums.unrealengine.com/t/play-animation-in-c/537189 "2022-04-23T01:29:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rick\_Astley2020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rick\_Astley2020](https://forums.unrealengine.com/u/Rick_Astley2020)\
**Post date:** [April 23, 2022, 1:29am UTC](https://forums.unrealengine.com/t/play-animation-in-c/537189/1 "2022-04-23T01:29:23Z")

</div>

I am trying to find how to play animations in C++. I already found from [here](https://forums.unrealengine.com/t/how-can-i-play-animations-strictly-from-c/330140/9) how to play the animation, but I can’t figure in which function I should play it from. I tried to play it from NativeUpdateAnimation() from my AnimInstance but it does not seems to do anything. Is there something I missed?

---

<div class="post-metadata">

**Author:** ![FlashTrance](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flashtrance/32/730424_2.png) [@FlashTrance](https://forums.unrealengine.com/u/FlashTrance)\
**Post date:** [April 23, 2022, 2:09am UTC](https://forums.unrealengine.com/t/play-animation-in-c/537189/2 "2022-04-23T02:09:01Z")

</div>

I recommend researching the functions you are overriding a bit before using them. NativeUpdateAnimation() runs every tick. You’re going to want to use this function pretty much exclusively to update properties your AnimationInstance needs to drive animation behavior.

As for which function to play animations from, there isn’t one specifically; you can play animations from just about anywhere you can get a reference to your AnimationInstance.

All you need is a reference to your AnimationInstance (which you will retrieve using a reference to the skeletal mesh you want to play an animation on) and you can use this reference to call “PlaySlotAnimationAsDynamicMontage”, as shown in the example you linked to.

---

<div class="post-metadata">

**Author:** ![Rick\_Astley2020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rick\_Astley2020](https://forums.unrealengine.com/u/Rick_Astley2020)\
**Post date:** [April 23, 2022, 2:35am UTC](https://forums.unrealengine.com/t/play-animation-in-c/537189/3 "2022-04-23T02:35:48Z")

</div>

Ok. But let’s say I pull info from NativeUpdateAnimation(), and let’s say my character starts jumping. NativeUpdateAnimation() would say jump = true, but which function is the most optimal to play the animation from in that case?
