UAnimMontage is undefined after update

Hello, I just converted my project to try out the preview build, but apparently UAnimMontage is undefined now.

Do I have to use something else now? I can post my code if needed.

Hey -

Can you elaborate on exactly what the issue is that you’re seeing? I am able to create a new class based on AnimMontage as well as create a new Animation Montage asset in the editor in the binary version of the preview. If possible, please provide the setup you’re using for your AnimMontage or the steps used to set it up to help me test on my end.

Sure! So this is the function I’m having trouble with:

` static FORCEINLINE UAnimMontage* GetAnimFromLibrary(const FString AnimName)
{
for (uint16 i = 0; i < AnimLibrary.Num(); i++)
if (AnimLibrary[i]->GetName() == AnimName)
return AnimLibrary[i];

	return NULL;
}`

At the GetName function I get this error: “error C2027: use of undefined type ‘UAnimMontage’”

I tested it just before updating to 4.13 (4.12.5 before), and there were no errors.

From my testing I found that AnimMontage is not included by default in the 4.13 version of the engine. Adding an include statement for the AnimMontage class ( #include "Runtime/Engine/Classes/Animation/AnimMontage.h") should prevent the compile error you’re getting.

Cheers

Why is it not included anymore? That’s… weird. :s

Hey -

This change was made as a clean-up effort in order to improve overall compile times.

But not package success!

Since every file of your project must include [PROJECTNAME].h, simply insert that include in that file.
In your case, put #include “Runtime/Engine/Classes/Animation/AnimMontage.h”