# \[BUG\] Crash when playing montage without AnimBlueprint (4.10.2)

**URL:** <https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585>\
**Category:** Character & Animation\
**Tags:** crashes, unreal-engine, bug-report, CPP, question\
**Created:** [February 15, 2016, 10:28pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585 "2016-02-15T22:28:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 15, 2016, 10:28pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/1 "2016-02-15T22:28:58Z")

</div>

Pretty simple to reproduce:

1. Add a skeletal mesh.
2. Create a new Animation Montage.
3. Add this montage to an Animation Blueprint using a montage slot (I used one I created).
4. Create a reference to an animation montage on your actor class with the skeletal mesh assigned to it. ( UAnimMontage\* TestMontage;)
5. Assign “None” for the Animation Blueprint on the skeletal mesh assigned in the actor class.
6. Call MontagePlay from coding.

Basically, when we call montage play, it will fail inside AnimInstance.cpp at

```
float UAnimInstance::Montage_Play(UAnimMontage * MontageToPlay, float InPlayRate/*= 1.f*/)
{
	if (MontageToPlay && (MontageToPlay->SequenceLength > 0.f) && MontageToPlay->HasValidSlotSetup())
	{
		->if (CurrentSkeleton->IsCompatible(MontageToPlay->GetSkeleton()))

```

By assigning the animation blueprint, everything works 100%. While I know this may not seem like an important bug, it would be nice to have an error thrown if we forget our animation blueprint (especially since it is a hard crash from the editor). Thanks so much for your time ^^!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [February 16, 2016, 3:18pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/2 "2016-02-16T15:18:47Z")

</div>

Hey -

What are you adding a skeletal mesh to? Are you referring to a character blueprint? Can you post the callstack and log files from the crash as well as the code you use to reference your animation and call MontagePlay?

Cheers

---

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 18, 2016, 9:50pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/3 "2016-02-18T21:50:57Z")

</div>

That’s correct. Sorry my instructions weren’t very accurate. You do need a character blueprint in order to call the montage (without the animation blueprint assigned to it). Let me drop in some screenshots and stuff to make things a bit more accurate:

I have my montage exposed to be selected within blueprints:  
[http://itzra.in/l2ain/share/screenshots/UE4Editor\_2016-02-18\_15-41-15.png](http://itzra.in/l2ain/share/screenshots/UE4Editor_2016-02-18_15-41-15.png)

This is normally where you’d set the animation blueprint, I didn’t (I noticed the crash because I accidentally forgot to set it).  
[http://itzra.in/l2ain/share/screenshots/UE4Editor\_2016-02-18\_15-41-59.png](http://itzra.in/l2ain/share/screenshots/UE4Editor_2016-02-18_15-41-59.png)

[http://itzra.in/l2ain/share/text/Diagnostics.txt](http://itzra.in/l2ain/share/text/Diagnostics.txt)  
[http://itzra.in/l2ain/share/file/UE4Minidump.dmp](http://itzra.in/l2ain/share/file/UE4Minidump.dmp)  
[http://itzra.in/l2ain/share/text/crashcallstack.txt](http://itzra.in/l2ain/share/text/crashcallstack.txt)  
[http://itzra.in/l2ain/share/text/CodeSnippet.txt](http://itzra.in/l2ain/share/text/CodeSnippet.txt)

Hopefully that makes sense. Like I said, it just needs validation to throw an error when you fire the montage off without an animation blueprint (I’m assuming because it can’t get the skeleton without the Animation Blueprint).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [February 19, 2016, 3:00pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/4 "2016-02-19T15:00:21Z")

</div>

I followed the instructions as best as I could but I did not get a crash when calling Montage\_Play(). Here are the steps I used to test:

1. Create a new class based on Character (MyCharacter)

2. In MyCharacter.h I added an AnimMontage pointer

3. In MyCharacter.cpp I added the call to Montage\_Play in the BeginPlay() function.

4. After compiling these changes, I made an Animation Montage (newAnim) and a blueprint based on MyCharacter (MyCharBP)

5. In MyCharBP, I set Dying Montage to newAnim and the Skeletal Mesh to the SK\_Mannequin.

With this setup I added an instance of the MyCharBP to the level and played in the editor. I did not get a crash and was able to exit PIE and start again. Can you elaborate on your reproduction steps to help me understand what I’m doing differently?

Additionally can you post the callstack and log files from the crash for more information?

---

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 19, 2016, 4:01pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/5 "2016-02-19T16:01:46Z")

</div>

That sounds exactly like what I’ve done. Without an animation blueprint added to the skeletal mesh of the character. Where would I find the callstack and log files from the crash?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [February 19, 2016, 5:02pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/6 "2016-02-19T17:02:28Z")

</div>

The callstack can be copied from the black Crash Reporter window when the crash occurs. The log files are saved inside the Project/Saved/Logs folder. After causing the crash, the most recent log file (based on timestamp) will be the most useful.

Also, can you let me know if using GetMesh()-\>GetAnimInstance() helps rather than accessing the mesh directly?

---

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 19, 2016, 8:20pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/7 "2016-02-19T20:20:55Z")

</div>

Were you unable to access the files in my previous post or were they not the correct ones? The callstack was directly copied and the log files were from the folder as well.

It’s all crashing when using GetMesh(). It ONLY crashes when I have it set to use an animation blueprint and the animation blueprint selected is NONE on the character mesh.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [February 22, 2016, 7:08pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/8 "2016-02-22T19:08:10Z")

</div>

I had only noticed the .dmp and the code snippet - I did not see the other two .txt files initially and I am looking over them now. The Montage\_Play function enter’s the first if() before crashing at the second if(). This leads me to believe that MontageToPlay is correctly however either CurrentSkeleton is not set properly or the GetSkeleton() call is failing. If possible, can you add a breakpoint in AIBeginDying where it calls for the montage to begin playing and then run the project in debug mode through Visual Studio? If/when the breakpoint is triggered, step through the code to find the value of Current Skeleton as well as the value returned from MontageToPlay-\>GetSkeleton()

---

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 22, 2016, 7:48pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/9 "2016-02-22T19:48:10Z")

</div>

Hey ,

I just stepped through everything like you asked. It seems that CurrentSkeleton is set to null (unable to the memory). I’ve uploaded a few snippets for you to look at:

[http://itzra.in/l2ain/share/text/Crash2.txt](http://itzra.in/l2ain/share/text/Crash2.txt)

The crash occurs immediately when we try to use CurrentSkeleton-\> because it has no value.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [February 24, 2016, 1:29pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/10 "2016-02-24T13:29:03Z")

</div>

I tired running through the setup steps from earlier and noticed that CurrentSkeleton was set the same for me as well. Could you send a copy of your project so that I can test the crash directly? If you’re able to zip the project you can post it here or you can upload it to Google drive or Dropbox and send me a private message on the forms with the download link for privacy.

---

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 26, 2016, 8:12pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/11 "2016-02-26T20:12:34Z")

</div>

Sent you a PM on the forums with the link.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [February 29, 2016, 5:53pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/12 "2016-02-29T17:53:58Z")

</div>

Hey -

You are correct that the crash is due to not having an Anim blueprint set in the “Anim Blueprint Generated Class” filed of the mesh’s details. I was able to reproduce the crash and have entered a report for investigation (UE-27594). Along with setting the animation blueprint, another solution is to change the Animation Mode to “Use Animation Asset” and the “Anim to Play” to your dying montage, then the crash will not occur.

Cheers

---

<div class="post-metadata">

**Author:** ![Nice\_Rain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nice\_Rain](https://forums.unrealengine.com/u/Nice_Rain)\
**Post date:** [February 29, 2016, 7:29pm UTC](https://forums.unrealengine.com/t/bug-crash-when-playing-montage-without-animblueprint-4-10-2/347585/13 "2016-02-29T19:29:49Z")

</div>

Awesome man! Glad to see it’s been tracked!
