UE5/GameplayTags
[UE5] 이펙트실행되면, 모든태그가져오기
Mini_96
2024. 6. 3. 19:55
1. 이펙트실행되면 실행될함수를 바인딩해놨다.
(이펙트가 실행되면), 태그컨테이너에 "에셋"태그들을 모두 담고
태그들을 로그로 찍는다.
void UAuraAbilitySystemComponent::EffectApplied(UAbilitySystemComponent* AbilitySystemComponent,
const FGameplayEffectSpec& EffectSpec, FActiveGameplayEffectHandle ActiveEffectHandle)
{
FGameplayTagContainer TagContainer;
EffectSpec.GetAllAssetTags(TagContainer); ///** Appends all tags that apply to this gameplay effect spec */
for(const FGameplayTag& Tag : TagContainer)
{
//TODO: Broadcast the tag to the Widget Controller
const FString Msg = FString::Printf(TEXT("GE Tag: %s"), *Tag.ToString());
GEngine->AddOnScreenDebugMessage(-1, 8.f, FColor::Blue, Msg); //key:-1 최신msg로 덮어쓰기x
}
}
2. 지속GE인 크리스탈에서 잘 작동함
GrantTag가아닌 AssetTag에 태그를 붙여줘야함.

3. Instant GE인 포션에서도 잘 작동함
4. 결과


5. 다음에할일 : 위젯으로 방송하기