Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
1 vote

JS 2D top down movement doesn't act as expected

Your issue is that you're clamping the x and y components of the velocity independently. So once the x value hits 100, it saturates. Meanwhile, if the mouse is still above the object, the y value ...
user avatar
  • 113k

Only top scored, non community-wiki answers of a minimum length are eligible