https://github.com/lcbx/godot_smoothmovement
fix jittery movement in godot - another method using extrapolation
https://github.com/lcbx/godot_smoothmovement
Last synced: 5 months ago
JSON representation
fix jittery movement in godot - another method using extrapolation
- Host: GitHub
- URL: https://github.com/lcbx/godot_smoothmovement
- Owner: Lcbx
- License: mit
- Created: 2021-07-30T11:11:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-20T18:57:20.000Z (over 3 years ago)
- Last Synced: 2025-10-20T08:54:35.196Z (9 months ago)
- Language: GDScript
- Homepage:
- Size: 19.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Follow-up to Garbaj's [Fixing Jittery Movement In Godot](https://www.youtube.com/watch?v=pqrD3B75yKo "link to video") video
Relevant script is [ImprovedMovement.gd](https://github.com/Lcbx/Godot_SmoothMovement/blob/master/ImprovedMovement.gd "link to script")
The project has a main scene with default(simple) vs improved movement.
This version :
* is simpler than his solution
* doesn't lag behind the physics model
* uses extrapolation rather than interpolation
* as such, needs a velocity vector
* requires special care when teleporting it around (see 'How to use')
### How to use
- Add [ImprovedMovement.gd](https://github.com/Lcbx/Godot_SmoothMovement/blob/master/ImprovedMovement.gd "link to script") to the project files
- change the type of existing _KinematicBody_ to _ImprovedKinematicBody_
- modify scripts to contain _'extends ImprovedKinematicBody'_
- modify scripts to implement the function **_implementMovement(delta)** as if it was **_physics_process**
- use the **velocity** variable to control it's movement the way you would a _RigidBody_
- call _changeTransform(newTransform)_ when changing the Node's translation directly
You can use the demo scene as a template.