Play animation in C++

I am trying to find how to play animations in C++. I already found from here 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?

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.

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?