Update Pistol for Projectile, VFX & SFX Relative to Crosshair

This commit is contained in:
Philip W 2024-02-27 19:46:35 +00:00
parent 80eec7267c
commit c392ebc5c3
6 changed files with 20 additions and 17 deletions

View File

@ -60,7 +60,7 @@
+CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")
[/Script/EngineSettings.GameMapsSettings]
EditorStartupMap=/Game/Levels/MainMenuLevel.MainMenuLevel
EditorStartupMap=/Game/Levels/AITest.AITest
LocalMapOptions=
TransitionMap=None
bUseSplitscreen=True

View File

@ -179,7 +179,7 @@ void ABaseWeaponClass::Fire()
traceEnd = traceStart + (GunStartArrow->GetForwardVector() * BulletDistance);
if (GetWorldTimerManager().IsTimerActive(timerHandle)) return;
GetWorld()->LineTraceSingleByChannel(outHit, traceStart, traceEnd, ECC_Visibility, collisionParams);
DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Black , false, 0.2f, 0U, 0.2f);
WeaponFired.Broadcast();
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
currentAmmoCount -= 1;
GenerateRecoilVector();

View File

@ -49,8 +49,6 @@ protected:
UFUNCTION(BlueprintImplementableEvent)
void HideReloadingWidget();
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
@ -185,6 +183,11 @@ public:
UFUNCTION(BlueprintImplementableEvent)
void HideNeedReloadUI();
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FWeaponFired);
UPROPERTY(BlueprintAssignable, Category = "Weapons")
FWeaponFired WeaponFired;
protected:
UArrowComponent* GunStartArrow;
bool bStopShooting = false;