# Play animation montage without Blueprints

**URL:** <https://forums.unrealengine.com/t/play-animation-montage-without-blueprints/390859>\
**Category:** Character & Animation\
**Tags:** slot, unreal-engine, CPP, question\
**Created:** [April 13, 2017, 9:09pm UTC](https://forums.unrealengine.com/t/play-animation-montage-without-blueprints/390859 "2017-04-13T21:09:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be014f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be014f9](https://forums.unrealengine.com/u/anonymous_user_5be014f9)\
**Post date:** [April 13, 2017, 9:09pm UTC](https://forums.unrealengine.com/t/play-animation-montage-without-blueprints/390859/1 "2017-04-13T21:09:27Z")

</div>

I am trying to play animation montage without using any blueprints.  
My character has 2 states - Idle/Walk/Run which is done by blend space 1D. and attack - which is done by animation montage. To start the blend space, in BeginPlay:

```
this->GetMesh()->PlayAnimation(this->m_walkRunIdleBS, true);

```

This seems to work well, The problem is playing the montage. On attack I do this:

```
UAnimInstance* animInstance = this->GetMesh()->GetAnimInstance();
LOG_CHECK_RETURN(animInstance != NULL, , "animInstance is null");

LOG_CHECK_RETURN(this->m_attackAM != NULL, , "m_attackAM is null");
DBG_DEF_PRINT("%f", animInstance->Montage_Play(this->m_attackAM));

```

LOG\_CHECK\_RETURN - checks the condition, is false returns from the function.  
DBG\_DEF\_PRINT - simple print

On attack I can see that 1.3333 is printed on the screen which means playing the montage succeed but instead of playing the montage, the character sort of “blink” between the animations for a few frames and returns to the blend animation.

I have read this: [Play animation montage (C++) - C++ - Epic Developer Community Forums](https://answers.unrealengine.com/questions/256672/play-animation-montage-c.html)  
I have tried to add slot to the montage as said but it did not work. I am pretty sure that I did it wrong. Will this help? how do I play slot animation montage right?

---

<div class="post-metadata">

**Author:** ![meetakshay99](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@meetakshay99](https://forums.unrealengine.com/u/meetakshay99)\
**Post date:** [October 4, 2018, 3:29pm UTC](https://forums.unrealengine.com/t/play-animation-montage-without-blueprints/390859/2 "2018-10-04T15:29:06Z")

</div>

Did you find anything for making it work? I too am trying the same thing.
