Bugfix Clicking Instantly Activates Combat
This commit is contained in:
parent
e91d059c56
commit
0de2753dff
BIN
Content/BlueprintAI/AI/AIBruh.uasset
(Stored with Git LFS)
BIN
Content/BlueprintAI/AI/AIBruh.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/BlueprintAI/AI/BTT_ChaseBruh.uasset
(Stored with Git LFS)
BIN
Content/BlueprintAI/AI/BTT_ChaseBruh.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/Top_layer_level.umap
(Stored with Git LFS)
BIN
Content/Levels/Top_layer_level.umap
(Stored with Git LFS)
Binary file not shown.
@ -37,17 +37,22 @@ void UHoldToInitCombat::TickComponent(float DeltaTime, ELevelTick TickType, FAct
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
//If the player is holding down the right mouse button for 3 seconds, then the player will enter combat mode
|
||||
if (bRightClickDown && RightClickDownTime < 0.1f)
|
||||
// //If the player is holding down the right mouse button for 3 seconds, then the player will enter combat mode
|
||||
// if (bRightClickDown && RightClickDownTime < 0.1f)
|
||||
// {
|
||||
// RightClickDownTime += DeltaTime;
|
||||
// }
|
||||
// else if (bRightClickDown && RightClickDownTime >= 0.1f)
|
||||
// {
|
||||
// //Enter Combat Mode
|
||||
// Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->StartCombat(TargetEnemy);
|
||||
// //UBlackboardComponent* TargetEnemyBlackboard = Cast<UBlackboardComponent>(TargetEnemy->GetComponentByClass(UBlackboardComponent::StaticClass()));
|
||||
// //TargetEnemyBlackboard->SetValueAsBool("IsInCombat", true);
|
||||
// OnRightClickUp();
|
||||
// }
|
||||
if (bRightClickDown)
|
||||
{
|
||||
RightClickDownTime += DeltaTime;
|
||||
}
|
||||
else if (bRightClickDown && RightClickDownTime >= 0.1f)
|
||||
{
|
||||
//Enter Combat Mode
|
||||
Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->StartCombat(TargetEnemy);
|
||||
//UBlackboardComponent* TargetEnemyBlackboard = Cast<UBlackboardComponent>(TargetEnemy->GetComponentByClass(UBlackboardComponent::StaticClass()));
|
||||
//TargetEnemyBlackboard->SetValueAsBool("IsInCombat", true);
|
||||
OnRightClickUp();
|
||||
}
|
||||
}
|
||||
@ -58,7 +63,7 @@ void UHoldToInitCombat::OnRightClickDown()
|
||||
{
|
||||
TargetEnemy = RightClickHit;
|
||||
bRightClickDown = true;
|
||||
InitCombatWidget->AddToViewport();
|
||||
//InitCombatWidget->AddToViewport();
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +73,7 @@ void UHoldToInitCombat::OnRightClickUp()
|
||||
RightClickDownTime = 0.0f;
|
||||
if (InitCombatWidget->IsInViewport())
|
||||
{
|
||||
InitCombatWidget->RemoveFromViewport();
|
||||
InitCombatWidget->RemoveFromParent();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user