How do I know whether the current playing montage is loop or not in c++ project?
I cannot find any function about that.
I thought there might be a neat way. anyway thanks!
Are you sure you are talking about montage and not juste animation ( or animationMontage segment )?
About segment, I would either play with meta data, either compare current composite sectionName with it’s nextSection name
Didn’t tested it but that could work
bool Montage_GetNextSectionID(UAnimMontage const* const Montage,UAnimInstance* AnimInstance) const
{
if (Montage && AnimInstance)
{
FAnimMontageInstance* MontageInstance = GetActiveInstanceForMontage(Montage);
if (MontageInstance)
{
float CurrentTime =MontageInstance->GetPosition();
float CurrentPosition;
const int32 CurrentSectionIndex = Montage->GetAnimCompositeSectionIndexFromPos(Position, CurrentPosition);
if (Montage->IsValidSectionIndex(CurrentSectionIndex))
{
FCompositeSection const & CurrentSection = Montage->GetAnimCompositeSection(SectionID);
return CurrentSection.NextSectionName ==CurrentSection.SectionName;
}
}
}
return false;
}