this post was submitted on 23 Jul 2023
7 points (88.9% liked)

Game Development

3426 readers
1 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] potoo22@programming.dev 3 points 1 year ago

If your doing the physics calculations on your own, you only need to run gravity physics when an onGround flag is false. You instead run a CheckOnGround() check to keep the onGround flag on. When it is not on ground, set a coyoteTimer and if CheckOnGround() is still false after the timer is up, then set onGround to false and run gravity physics.

They coyoteTimer time is dependent on the CheckOnGround radius and model speed, but it should be hardly noticeable. Run some tests and see what feels good.

Disclaimer, I'm not a professional, so I'm definitely open to better suggestions.