When I created a camera rig transition with Gameplay tag condition, I noticed that the transition will be used even if the gameplay tags do not match. I think it is because the variables bPreviousMatches and bNextMatches are true even if the query doesnt match
`bool UGameplayTagTransitionCondition::OnTransitionMatches(const FCameraRigTransitionConditionMatchParams& Params) const
{
bool bPreviousMatches = true;
if (!PreviousGameplayTagQuery.IsEmpty())
{
if (Params.FromCameraRig)
{
FGameplayTagContainer TagContainer;
Params.FromCameraRig->GetOwnedGameplayTags(TagContainer);
if (TagContainer.MatchesQuery(PreviousGameplayTagQuery))
{
bPreviousMatches = true;
}
}
else
{
bPreviousMatches = false;
}
}
bool bNextMatches = true;
if (!NextGameplayTagQuery.IsEmpty())
{
if (Params.ToCameraRig)
{
FGameplayTagContainer TagContainer;
Params.ToCameraRig->GetOwnedGameplayTags(TagContainer);
if (TagContainer.MatchesQuery(NextGameplayTagQuery))
{
bNextMatches = true;
}
}
else
{
bNextMatches = false;
}
}
return bPreviousMatches && bNextMatches;
}
-------------------- Suggested fix: ----------------------------------
bool UGameplayTagTransitionCondition::OnTransitionMatches(const FCameraRigTransitionConditionMatchParams& Params) const
{
bool bPreviousMatches = false;
if (!PreviousGameplayTagQuery.IsEmpty())
{
if (Params.FromCameraRig)
{
FGameplayTagContainer TagContainer;
Params.FromCameraRig->GetOwnedGameplayTags(TagContainer);
if (TagContainer.MatchesQuery(PreviousGameplayTagQuery))
{
bPreviousMatches = true;
}
}
}
bool bNextMatches = false;
if (!NextGameplayTagQuery.IsEmpty())
{
if (Params.ToCameraRig)
{
FGameplayTagContainer TagContainer;
Params.ToCameraRig->GetOwnedGameplayTags(TagContainer);
if (TagContainer.MatchesQuery(NextGameplayTagQuery))
{
bNextMatches = true;
}
}
}
return bPreviousMatches && bNextMatches;
}`