Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Jittery horizontal movement speed near 0 #14

Open
fourthedesign opened this issue Feb 13, 2023 · 0 comments
Open

Bug: Jittery horizontal movement speed near 0 #14

fourthedesign opened this issue Feb 13, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fourthedesign
Copy link
Contributor

Turning speed on ShipController is calculated every frame with the following line of code:

CurrentTurningSpeed = Mathf.Clamp(
    CurrentTurningSpeed + 
    ((turningSign == 0 && !Mathf.Approximately(CurrentTurningSpeed, 0f)) ? 
        -Mathf.Sign(CurrentTurningSpeed) * TurningSpeedDamping * Time.deltaTime 
        : 
        turningSign * TurningAccceleration * Time.deltaTime
    ), -TurningMaxSpeed, TurningMaxSpeed);

in Move(), Assets/Scripts/Player/ShipController.cs.

This causes a jitter and "feedback loop" of the value of movement speed from negative to positive, whenever the speed approaches 0 as you stop pressing A or D to move horizontally.

Fixing this is quite important as there is currently a barely noticeable but still noticeable jitter.

@fourthedesign fourthedesign added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant