Frame independent friction
I've been trying to make a game using GameMaker Studio 2, but I've run into some problems when trying to add delta timing. My friction code divides the player's velocity by a set value every frame, but on lower framerates, the player moves a lot faster. How would I make the player's movement to be frame independent. Code I've been using is just below: //broken frame independent code horizontalVelocity += movementSpeed * movementDirection horizontalVelocity /= horizontalFriction * deltaTimeMultiplier //note that deltaTimeMultiplier is just (delta_time / 1000000) / (1/60) /* ... collision code .
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.