Skip to content

CharacterController2D::Walk Deceleration not working #4

@NomadArtisan

Description

@NomadArtisan

This is an amazing asset you've created, thank you!
Deceleration in CharacterController2D::Walk is only being called once, and then the speed.x will be set to 0 on the next call to walk when speed.x is assigned at line 328 of CharacterController2D

I fixed it by replacing the else at line 325 with
else if (direction != 0 && (speed.x == 0 || Mathf.Sign(direction) == Mathf.Sign(speed.x)))

I haven't thoroughly tested this fix, but it appears to work for me on initial testing.

Regards,
-NomadArtisan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions