Modify movement to feel more intuitive (align with direction faster)
This commit is contained in:
@@ -60,6 +60,13 @@ protected:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
|
||||
float DragCoefficient = 0.05f;
|
||||
|
||||
// How quickly velocity aligns with new direction
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement", meta = (ClampMin = "0.0", ClampMax = "10.0"))
|
||||
float VelocityAlignmentSpeed = 4.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement", meta = (ClampMin = "0.0", ClampMax = "1.0", ToolTip = "How much of the current velocity is maintained when changing direction (0 = none, 1 = full)"))
|
||||
float DirectionalInertia = 0.3f;
|
||||
|
||||
// Input functions
|
||||
void HandleThrottleStarted(const FInputActionValue& Value);
|
||||
void HandleThrottleReleased(const FInputActionValue& Value);
|
||||
@@ -81,4 +88,7 @@ private:
|
||||
FVector2D MouseDeltaSmoothed;
|
||||
FVector2D LastMouseDelta;
|
||||
float MouseSmoothingSpeed = 10.0f;
|
||||
|
||||
bool bWasThrottlePressed;
|
||||
FVector DesiredVelocityDirection;
|
||||
};
|
||||
Reference in New Issue
Block a user