# How can I play animations strictly from C++?

**URL:** <https://forums.unrealengine.com/t/how-can-i-play-animations-strictly-from-c/330140>\
**Category:** Character & Animation\
**Tags:** unreal-engine, CPP, question\
**Created:** [August 27, 2015, 10:51pm UTC](https://forums.unrealengine.com/t/how-can-i-play-animations-strictly-from-c/330140 "2015-08-27T22:51:58Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![rantrod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rantrod](https://forums.unrealengine.com/u/rantrod)\
**Post date:** [September 14, 2015, 11:10pm UTC](https://forums.unrealengine.com/t/how-can-i-play-animations-strictly-from-c/330140/9 "2015-09-14T23:10:34Z")

</div>

Partial answers:

Playing Blend Spaces from C++:

- Set a UPROPERTY for your BlendSpace to be set in the Editor:

- Play the animation and set the BlendSpace parameter (0-100 how far to mix the anims). In this example, I have a 1D BlendSpace that I’m blending along the ‘X’ axis (as set in the editor):

The example used is with a 1D Blend Space, but it also work for 2D or 3D blend spaces 🙂

…

To Play an animation in a slot:

- As before add the UPROPERTY with the animation sequence to play:

- Play the Animation:

To Play a simple full body animation and stop at the end:

```
MyAnimTimer = AnimInstance->Montage_Play(MyMontage);
GetWorldTimerManager().SetTimer(PauseMontageTimerHandle, this, &MyActor::PauseMontageFunc, MyAnimTimer, false);

```

Where MyAnimTimer is a float, and PauseMontageTimerHandle is a FTimerHandle.

In MyActor::PauseMontageFunc:

```
AnimInst->Montage_Pause();

```

To Play a simple full body animation and jump ahead to a section. Montage\_Play(anim, play speed) and Montage\_JumpToSection.

…

To Play an animation additively use the PlaySlotAnimationAsDynamicMontage function as before, into a slot set up like this: [Using Layered Animations in Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/latest/INT/Engine/Animation/AnimHowTo/AdditiveAnimations/index.html)

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-play-animations-strictly-from-c/330140)._
