Apologies for the delay.
Using the code example, character source, and animation, I still couldn’t reproduce your issue. Is this something that you can build a little test project around in vanilla unreal to see if you can recreate it? Is there any other code you have added around bone adjustment in your hitbox setup?
In terms of your other question, you can’t access the current animation time directly. But you can get the current anim notify’s that are available and check if they are playing.
`void UMyAnimNotifyState::DrawInEditor(FPrimitiveDrawInterface* PDI, USkeletalMeshComponent* MeshComp, const UAnimSequenceBase* Animation,
const FAnimNotifyEvent& NotifyEvent) const
{
const float NotifyStartTime = NotifyEvent.GetTriggerTime();
const float NotifyEndTime = NotifyEvent.GetEndTriggerTime();
TArray NotifyEventReferences = MeshComp->GetAnimInstance()->NotifyQueue.AnimNotifies; //Get the current notify event references playing.
for (FAnimNotifyEventReference NotifyEventReference : NotifyEventReferences)
{
if (NotifyEvent == *NotifyEventReference.GetNotify()) // Test that the notify definition and the reference are the same.
{
if (NotifyEventReference.GetCurrentAnimationTime() < NotifyEndTime && NotifyEventReference.GetCurrentAnimationTime() > NotifyStartTime) //Test the accumulated time
{
FTransform Transform = MeshComp->GetSocketTransform(“HitBox1”);
FVector BoxExtent(5.0f, 5.0f, 5.0f);
FBox Box = FBox::BuildAABB( FVector :: Zero(), BoxExtent) ;
DrawWireBox(PDI, Transform. ToMatrixWithScale(), Box, FColor::Green, SDPG_World);
}
}
}
Super::DrawInEditor(PDI, MeshComp, Animation, NotifyEvent);
}`Here’s some modified code to show the example.