BossFight - 적 패링 반응 구현

김대겸·2025년 5월 20일

적 패링 반응 구현

이번에는 Parry에 성공 시 적의 반응을 구현 해보자.

Parry 성공 시 GameplayEvent를 발송, 적 캐릭터의 애니메이션을 출력 하도록 구현 해보자.

🎮 APlayerWeapon.cpp

void APlayerWeapon::OnWeaponParryOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	UBFFunctionLibrary::AddGameplayTagToActorIfNone(GetOwner(), BFGameplayTag::Player_Status_ParrySuccess)	;
	UAbilitySystemBlueprintLibrary::SendGameplayEventToActor(OtherActor->GetOwner(), BFGameplayTag::Enemy_Event_ParryHit, FGameplayEventData());
}

위와 같이 Parrying 성공 시 SendGameplayEventToActor()함수를 통해 GameplayEvent를 발송 하도록 구현 하였다.

이후 GA_Enemy_ParryHit_Base 어빌리티를 작성 하고 아래와 같이 설정 해주었다.

노드를 위와 같이 배치하고 디테일 텝을 아래와 같이 수정 해주었다.

그 다음 위의 Ability를 상속 받아 GA_ParryHit_Bear를 생성 하고, DA_Bear에 아래와 같이 추가 해주었다.

작동 영상

적 공격에 맞춰 플레이어의 공격을 겹치게하면, 위와같이 Parrying에 성공 한것으로 판정하여, 애니메이션을 재생하고, 적의 공격을 끊도록 구현 하였다.

다음에는 각 무기별 특수 능력을 하나씩 구현 해볼 예정이다.

0개의 댓글