diff --git a/Source/Exo/Private/Characters/Components/ShootingComponent.cpp b/Source/Exo/Private/Characters/Components/ShootingComponent.cpp index 80096bd..d27b616 100644 --- a/Source/Exo/Private/Characters/Components/ShootingComponent.cpp +++ b/Source/Exo/Private/Characters/Components/ShootingComponent.cpp @@ -77,7 +77,7 @@ AActor* UShootingComponent::ExecuteLineTrace(float LineRange) // DEBUG if (bShowDebugLine) - DrawDebugLine(GetWorld(), ViewLocation, EndVector, FColor::Red, false, 1.0f, 0, 1.0f); + DrawDebugLine(GetWorld(), ViewLocation, EndVector, FColor::Red, false, 5.0f, 0, 1.0f); if (GetWorld()->LineTraceSingleByChannel(Hit, ViewLocation, EndVector, ECC_Visibility, QueryParams) && IsValid(Hit.GetActor()) && Hit.GetActor()->Implements()) @@ -264,12 +264,11 @@ void UShootingComponent::StopAiming() TargetFOV = DefaultFOV; } -void UShootingComponent::Throw() // Wymaga dopracowania +void UShootingComponent::Throw() { if (IsValid(ThrowableItem)) - { - FVector ForwardVector = PlayerCharacter->GetActorForwardVector(); - FVector DroppedPos = PlayerCharacter->GetActorLocation() + (ForwardVector * 100.f); + { + FVector DroppedPos = CameraManager->GetCameraLocation() + CameraManager->GetActorForwardVector() * 100.f; FTransform DroppedTransform = PlayerCharacter->GetActorTransform(); DroppedTransform.SetLocation(DroppedPos); @@ -285,7 +284,7 @@ void UShootingComponent::Throw() // Wymaga dopracowania ThrowedItem->ThrowableType = ThrowableItem->ThrowableType; FVector ThrowVector = (ThrowedItem->GetActorLocation() - PlayerCharacter->GetActorLocation()).GetSafeNormal(); - ThrowedItem->Mesh->SetPhysicsLinearVelocity(ThrowVector * 800.f); + ThrowedItem->Mesh->SetPhysicsLinearVelocity(ThrowVector * 1000.f); // Need force to change to the game if (ThrowableItem->Quantity <= 0) {