Basic mouse look implementation (only left/right)

This commit is contained in:
2025-02-16 16:31:45 +05:30
parent 49895ec6a6
commit 482f386975
6 changed files with 97 additions and 44 deletions

View File

@@ -54,13 +54,16 @@ protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
float RotationSpeed = 100.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
float MouseSensitivity = 2.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
float DragCoefficient = 0.1f;
// Input functions
void HandleThrottleStarted(const FInputActionValue& Value);
void HandleThrottleReleased(const FInputActionValue& Value);
void HandleMouseControl(const FInputActionValue& Value);
void HandleMouseLook(const FInputActionValue& Value);
void HandleFire(const FInputActionValue& Value);
private:
@@ -69,7 +72,13 @@ private:
float TargetThrust;
bool bThrottlePressed;
FVector CurrentVelocity;
FRotator ShipRotation;
FRotator TargetRotation;
float CurrentPitch;
float CurrentYaw;
APlayerController* PlayerControllerRef;
FVector2D MouseDeltaSmoothed;
FVector2D LastMouseDelta;
float MouseSmoothingSpeed = 10.0f;
};