Hi guys, I hope you can solve my problem.
I converted my project from 4.9 to 4.11 and suddenly everything that plays an animation doesn’t work anymore.
Here the code that doesn’t work properly now:
ADoor::ADoor(const FObjectInitializer& PCIP) : Super(PCIP){
DefaultMesh = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Base Mesh"));
RootComponent = DefaultMesh;
DefaultMesh->SetSkeletalMesh(DoorMesh);
DefaultMesh->SetAnimationMode(EAnimationMode::AnimationSingleNode);
PrimaryActorTick.bCanEverTick = true;
}
void ADoor::OpenDoor()
{
DefaultMesh->PlayAnimation(OpenDoorAnimation, false);
isOpened = true;
}
OpenDoorAnimation is a UAnimationAsset*. Back in 4.9 this code worked no problem, but right now it just doesn’t do anything.
I have also tried this for my OpenDoor method:
void ADoor::OpenDoor(){
DefaultMesh->AnimationData.AnimToPlay = OpenDoorAnimation;
DefaultMesh->Play(false);
isOpened = true;
}
But it doesn’t do anything either.
Has there been any change in the API that changes how that function works? I would love to get some clarifications.
Thanks in advance.