Dear experts,
I have an AnimMontage that should play after my MainCharacter picks up a sword and I click the left mouse button to start attacking. I get a warning in the log:
#LogAnimMontage: Warning: JumpToSectionName StandingMeleeAttackBackhand bEndOfSection: 0 failed for Montage AM_CombatMontage
Even when I compile from Visual Studio I immediately get this
LogScript: Warning: Accessed None trying to read property MainCharBP_MyMainAnimInstance_C /Engine/Transient.World_6:PersistentLevel.SkeletalMeshActor_0.SkeletalMeshComponent0.BP_MyMainAnimInstance_C_0Function /Game/Blueprints/BP_MyMainAnimInstance.BP_MyMainAnimInstance_C:ExecuteUbergraph_BP_MyMainAnimInstance:0060
It looks like it can’t access my montage or the MainCharBP is not available.
On the character I am calling the Montage when I Attack()
I have selected the AnimMontage in the BP of my character
In my “MainAnimInstance.cpp” file I have this:
#include "MainAnimInstance.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "MainCharacter.h"
void UMainAnimInstance::NativeInitializeAnimation()
{
if (Pawn == nullptr)
{
Pawn = TryGetPawnOwner();
if (Pawn)
{
MainChar = Cast<AMainCharacter>(Pawn);
}
}
}
and when I debug it, it looks okay to me, I see the MainChar:
I am lost here, does anyone have an idea how to solve this?
I also deleted the MainChar Blueprint and recreated it, but it doesn’help.
Thank you, Peter