Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

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 ^^!

Product Version: UE 4.10
more ▼

asked Feb 15 '16 at 10:28 PM in Bug Reports

avatar image

249 13 14 30

avatar image Doug E ♦♦ STAFF Feb 16 '16 at 03:18 PM

Hey walk12288-

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?


Doug Wilson

avatar image Nice_Rain Feb 18 '16 at 09:50 PM

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

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/text/Diagnostics.txt http://itzra.in/l2ain/share/file/UE4Minidump.dmp http://itzra.in/l2ain/share/text/crashcallstack.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).

avatar image Doug E ♦♦ STAFF Feb 19 '16 at 03:00 PM

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

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "AI|Dying") UAnimMontage* DyingMontage;

  3. In MyCharacter.cpp I added the call to Montage_Play in the BeginPlay() function.

    if (DyingMontage) { if (GEngine) { GetMesh()->GetAnimInstance()->Montage_Play(DyingMontage); GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Red, TEXT("MontageSetup")); }


  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?

avatar image Nice_Rain Feb 19 '16 at 04:01 PM

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?

avatar image Doug E ♦♦ STAFF Feb 19 '16 at 05:02 PM

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?

avatar image Nice_Rain Feb 19 '16 at 08:20 PM

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.

avatar image Doug E ♦♦ STAFF Feb 22 '16 at 07:08 PM

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 read 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()

avatar image Nice_Rain Feb 22 '16 at 07:48 PM

Hey Doug,

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


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

avatar image Doug E ♦♦ STAFF Feb 24 '16 at 01:29 PM

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.

avatar image Nice_Rain Feb 26 '16 at 08:12 PM

Sent you a PM on the forums with the link.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey walk12288-

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.


Doug Wilson

more ▼

answered Feb 29 '16 at 05:53 PM

avatar image Nice_Rain Feb 29 '16 at 07:29 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question