diff --git a/Content/Assets/Blocks/SM_Block.uasset b/Content/Assets/Blocks/SM_Block.uasset index ef84dde..66fcbd1 100644 Binary files a/Content/Assets/Blocks/SM_Block.uasset and b/Content/Assets/Blocks/SM_Block.uasset differ diff --git a/Content/Blueprints/BP_FireworksPawn.uasset b/Content/Blueprints/BP_FireworksPawn.uasset index d20147f..7e9d89c 100644 Binary files a/Content/Blueprints/BP_FireworksPawn.uasset and b/Content/Blueprints/BP_FireworksPawn.uasset differ diff --git a/Content/Blueprints/BP_SpawnManager.uasset b/Content/Blueprints/BP_SpawnManager.uasset index 9bfcb87..bbaa162 100644 Binary files a/Content/Blueprints/BP_SpawnManager.uasset and b/Content/Blueprints/BP_SpawnManager.uasset differ diff --git a/Content/Blueprints/BP_TestActor.uasset b/Content/Blueprints/BP_TestActor.uasset index 3c59907..b8225a5 100644 Binary files a/Content/Blueprints/BP_TestActor.uasset and b/Content/Blueprints/BP_TestActor.uasset differ diff --git a/Content/Blueprints/Blocks/BP_Block.uasset b/Content/Blueprints/Blocks/BP_Block.uasset index 623be7a..305ca14 100644 Binary files a/Content/Blueprints/Blocks/BP_Block.uasset and b/Content/Blueprints/Blocks/BP_Block.uasset differ diff --git a/Content/Blueprints/UI/BP_IngameScreen.uasset b/Content/Blueprints/UI/BP_IngameScreen.uasset index 0c1ce06..f501239 100644 Binary files a/Content/Blueprints/UI/BP_IngameScreen.uasset and b/Content/Blueprints/UI/BP_IngameScreen.uasset differ diff --git a/Content/Blueprints/UI/BP_Menu.uasset b/Content/Blueprints/UI/BP_Menu.uasset index a8170a8..4e4f723 100644 Binary files a/Content/Blueprints/UI/BP_Menu.uasset and b/Content/Blueprints/UI/BP_Menu.uasset differ diff --git a/Content/Blueprints/UI/BP_WristMenu.uasset b/Content/Blueprints/UI/BP_WristMenu.uasset index 1f978a0..f061820 100644 Binary files a/Content/Blueprints/UI/BP_WristMenu.uasset and b/Content/Blueprints/UI/BP_WristMenu.uasset differ diff --git a/Content/Data/DT_FireworkTemplates.uasset b/Content/Data/DT_FireworkTemplates.uasset index 06e7c94..455816f 100644 Binary files a/Content/Data/DT_FireworkTemplates.uasset and b/Content/Data/DT_FireworkTemplates.uasset differ diff --git a/Content/Levels/L_MainLevel.umap b/Content/Levels/L_MainLevel.umap index c06bef7..b02a10f 100644 Binary files a/Content/Levels/L_MainLevel.umap and b/Content/Levels/L_MainLevel.umap differ diff --git a/Content/UI/UI_ShopTile.uasset b/Content/UI/UI_ShopTile.uasset index 0f39d48..fd28053 100644 Binary files a/Content/UI/UI_ShopTile.uasset and b/Content/UI/UI_ShopTile.uasset differ diff --git a/Content/UI/W_HoldToPause.uasset b/Content/UI/W_HoldToPause.uasset index 8e00b53..8f1ce62 100644 Binary files a/Content/UI/W_HoldToPause.uasset and b/Content/UI/W_HoldToPause.uasset differ diff --git a/Content/UI/W_InLevelScreen.uasset b/Content/UI/W_InLevelScreen.uasset index 76dcfbd..7b07195 100644 Binary files a/Content/UI/W_InLevelScreen.uasset and b/Content/UI/W_InLevelScreen.uasset differ diff --git a/Content/UI/W_MainMenu.uasset b/Content/UI/W_MainMenu.uasset index af6d9b7..e21c0c2 100644 Binary files a/Content/UI/W_MainMenu.uasset and b/Content/UI/W_MainMenu.uasset differ diff --git a/Content/UI/W_Shop.uasset b/Content/UI/W_Shop.uasset index 29fe57c..7e8415b 100644 Binary files a/Content/UI/W_Shop.uasset and b/Content/UI/W_Shop.uasset differ diff --git a/Source/FireworkDuels/FireworksPawn.cpp b/Source/FireworkDuels/FireworksPawn.cpp index 25496b6..806fca0 100644 --- a/Source/FireworkDuels/FireworksPawn.cpp +++ b/Source/FireworkDuels/FireworksPawn.cpp @@ -96,7 +96,6 @@ void AFireworksPawn::Tick(float DeltaTime) Super::Tick(DeltaTime); SampleHandVelocities(); TryUpdateLasers(); - TryUpdateTeleportVisual(); } // Called to bind functionality to input @@ -282,20 +281,13 @@ void AFireworksPawn::TryUpdateLasers() // Check if this hand is grabbing anything, if not - continue if (!IsGrabbingL) { - - // Check if is pointing at any widget - if yes, omit trace and show laser - if (WidgetInteractionL->IsOverHitTestVisibleWidget()) { - LaserL->SetHiddenInGame(false); - LaserL->SetRelativeScale3D(FVector(WidgetInteractionL->GetLastHitResult().Distance, LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z)); - } // If not pointing widget, check if Laser (teleport) button is pressed - if yes, show laser - else if (TryShowLaserL) + if (TryShowLaserL) { FVector StartLocation = LaserL->GetComponentLocation(); FVector EndLocation = StartLocation + (WidgetInteractionL->GetForwardVector() * WidgetInteractionL->InteractionDistance); GetWorld()->LineTraceSingleByChannel(CurrentLaserHitL, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility); - LaserL->SetHiddenInGame(false); - LaserL->SetRelativeScale3D(FVector(CurrentLaserHitL.Distance, LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z)); + LaserL->SetRelativeScale3D(FVector((CurrentLaserHitL.Distance >= 5.0f ? CurrentLaserHitL.Distance : 1000.0f), LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z)); } // If the laser is visible, and should not - hide it else if(!LaserL->bHiddenInGame) { @@ -307,65 +299,17 @@ void AFireworksPawn::TryUpdateLasers() // Check if this hand is grabbing anything, if not - continue if (!IsGrabbingR) { - - // Check if is pointing at any widget - if yes, omit trace and show laser - if (WidgetInteractionR->IsOverHitTestVisibleWidget()) { - LaserR->SetHiddenInGame(false); - LaserR->SetRelativeScale3D(FVector(WidgetInteractionR->GetLastHitResult().Distance, LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z)); - } // If not pointing widget, check if Laser (teleport) button is pressed - if yes, show laser - else if (TryShowLaserR) + if (TryShowLaserR) { FVector StartLocation = LaserR->GetComponentLocation(); FVector EndLocation = StartLocation + (WidgetInteractionR->GetForwardVector() * WidgetInteractionR->InteractionDistance); GetWorld()->LineTraceSingleByChannel(CurrentLaserHitR, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility); - LaserR->SetHiddenInGame(false); - LaserR->SetRelativeScale3D(FVector(CurrentLaserHitR.Distance, LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z)); + LaserR->SetRelativeScale3D(FVector((CurrentLaserHitR.Distance >= 5.0f ? CurrentLaserHitR.Distance : 1000.0f), LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z)); } // If the laser is visible, and should not - hide it else if (!LaserR->bHiddenInGame) { LaserR->SetHiddenInGame(true); } } -} - -// Try update teleport visual -void AFireworksPawn::TryUpdateTeleportVisual() -{ - bool RightLaserCanTeleport = !LaserR->bHiddenInGame && (IsValid(CurrentLaserHitR.GetActor()) ? CurrentLaserHitR.GetActor()->ActorHasTag(TEXT("Ground")) : false); - bool LeftLaserCanTeleport = !LaserL->bHiddenInGame && (IsValid(CurrentLaserHitL.GetActor()) ? CurrentLaserHitL.GetActor()->ActorHasTag(TEXT("Ground")) : false); - - // Firstly cover the case of both hands pointing at ground with laser - if (RightLaserCanTeleport && LeftLaserCanTeleport) - { - if (DominatingHand == EControllerHand::Left) - { - TeleportVisual->SetActorHiddenInGame(false); - TeleportVisual->SetActorLocation(CurrentLaserHitL.Location); - return; - } - else - { - TeleportVisual->SetActorHiddenInGame(false); - TeleportVisual->SetActorLocation(CurrentLaserHitR.Location); - return; - } - } - - // Check if any hand is pointing laser at the ground - if (LeftLaserCanTeleport) - { - TeleportVisual->SetActorHiddenInGame(false); - TeleportVisual->SetActorLocation(CurrentLaserHitL.Location); - return; - } - else if (RightLaserCanTeleport) - { - TeleportVisual->SetActorHiddenInGame(false); - TeleportVisual->SetActorLocation(CurrentLaserHitR.Location); - return; - } - else { - TeleportVisual->SetActorHiddenInGame(true); - } } \ No newline at end of file diff --git a/Source/FireworkDuels/FireworksPawn.h b/Source/FireworkDuels/FireworksPawn.h index bec124f..3656f6e 100644 --- a/Source/FireworkDuels/FireworksPawn.h +++ b/Source/FireworkDuels/FireworksPawn.h @@ -176,7 +176,4 @@ public: UFUNCTION() void TryUpdateLasers(); - - UFUNCTION() - void TryUpdateTeleportVisual(); };