Basic mouse look implementation (only left/right)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user