# How do i play an animation montage in reverse in c++?

**URL:** <https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925>\
**Category:** Character & Animation\
**Tags:** reverse, unreal-engine, CPP, question\
**Created:** [June 28, 2014, 1:34am UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925 "2014-06-28T01:34:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [June 28, 2014, 1:34am UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/1 "2014-06-28T01:34:28Z")

</div>

Hello i’m trying to play an animation montage but played in reverse, i tried using:

```
MyCharacter->PlayAnimMontage(MyAnimMontage, -1.0f);

```

But the animation freezes. I noticed on Persona that if i set Rate Scale to -1.0 he reverses the animation, but the InPlayRate parameter in C++ doesn’t seem to have the same behaviour. Thank you

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [June 28, 2014, 2:10pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/2 "2014-06-28T14:10:02Z")

</div>

this is a bug I encountered in the Beta, it looks like it still has not been fixed, Epic please help!

🙂

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [June 28, 2014, 5:15pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/3 "2014-06-28T17:15:18Z")

</div>

Thnks , a possible workaround for this is creating a new AnimMontage with Rate Scale -1.0f, but that is not very practical ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [June 30, 2014, 10:48pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/4 "2014-06-30T22:48:00Z")

</div>

Hi xlar8or,

We are aware of this issue with anim montages. It is currently on our list of issues to correct. Unfortunately I do not have any way of knowing when we will have this issue fixed.

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [July 1, 2014, 1:02am UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/5 "2014-07-01T01:02:22Z")

</div>

Thanks for the support, i will be waiting for the fix 🙂

---

<div class="post-metadata">

**Author:** ![vipeout](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vipeout](https://forums.unrealengine.com/u/vipeout)\
**Post date:** [November 3, 2016, 3:20pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/6 "2016-11-03T15:20:01Z")

</div>

Hows the issue going? I’m encountering the same issue (although not using Pawn but regular AnimInstance montage functions) and regardless of how I try to set it up (without blend / setting the position to the length of anim right inside Montage\_Play func, before Play() is called) it just doesn’t work.

```
			NewInstance->Initialize(MontageToPlay);
			if (InPlayRate < 0.0f)
				NewInstance->SetPosition(MontageToPlay->SequenceLength);
			NewInstance->Play(InPlayRate);
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [November 3, 2016, 4:00pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/7 "2016-11-03T16:00:30Z")

</div>

Hi vipeout,

What version of the Engine are you using currently? We had a ticket in for this issue that was marked as fixed in 4.12. If you are using 4.12 or later, would you be able to provide more details about how you are setting this up, or perhaps a small sample project that shows the behavior?

---

<div class="post-metadata">

**Author:** ![vipeout](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vipeout](https://forums.unrealengine.com/u/vipeout)\
**Post date:** [November 3, 2016, 4:37pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/8 "2016-11-03T16:37:32Z")

</div>

4.13.1 I’m having a skeletalmesh component inside a class derived from AActor. When I’m creating a simple montage based on anim sequence (right click → create → Montage) play forward goes ok, but backwards doesn’t.

At first it just threw OnMontageFinished in the next tick (when the anim thread done it’s job) and after seting the position in the way I described above it does “finish” the animation after proper time, but nothing happens to the skeletal mesh in question. I’d like the animation to jump to the end (due to the set pos) and then go reverse from there.

What is happening is, well, nothing. I’ll try making a sample project for you, but I haven’t really done a custom C++ sample (only BP ones) before and not really sure how would I go about it. Theoretically Montage\_Play is callable from BP so i’ll start the sample with that, however using blueprint for the final solution won’t work for me.

---

<div class="post-metadata">

**Author:** ![vipeout](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vipeout](https://forums.unrealengine.com/u/vipeout)\
**Post date:** [November 4, 2016, 2:04pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/9 "2016-11-04T14:04:08Z")

</div>

Unfortunately, it’s impossible for me to provide you with the sample project, because there are no skeletal mesh and animation assets in the starter content, and the ones I’m working on cannot be shared. All I can give you are the repro steps:

1. Place skeletal mesh on level
2. Create an animation for it and create a basic montage based on it, that just plays the anim, nothing more (with playrate 1.0, the default)
3. Create anim BP for it
4. Do in the blueprint something like this:

 ![113781-repro.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/8/348c917a7db454931d935dcd2bfb29dee8058479.jpeg)

And the anim is not played from backwards. Stops in the next gamethread tick that it starts from. With my change in \*.cpp as shown above it still doesn’t work, it’s simply broken differently.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [November 11, 2016, 3:56pm UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/10 "2016-11-11T15:56:08Z")

</div>

Hi vipeout,

Thank you for the additional clarification, and I apologize for the delay in getting back to you. With the information that you provided I was able to see the issue that you described. After doing some additional testing and research, it looks like what was happening here was that the start position for the Montage Play node was internally being set to 0. I was able to find out that this has been addressed for 4.14 by exposing the start position to allow you to start playing the montage at any point (it still defaults to 0). I ran some tests in 4.14 Preview 3 using the setup that you showed and when I set the start position to the end of the Montage, the animation would play correctly in reverse. If you have a to try 4.14 Preview 3, does `Montage_Play()` work for you there?

---

<div class="post-metadata">

**Author:** ![vipeout](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vipeout](https://forums.unrealengine.com/u/vipeout)\
**Post date:** [November 16, 2016, 11:23am UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/11 "2016-11-16T11:23:41Z")

</div>

Works fine.

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [November 16, 2016, 11:30am UTC](https://forums.unrealengine.com/t/how-do-i-play-an-animation-montage-in-reverse-in-c/286925/12 "2016-11-16T11:30:27Z")

</div>

I’m glad it’s finally fixed 🙂
