Skip to content

Occasional jitter when KinematicBody2D moved in _physics_process() #41380

@2nafish117

Description

@2nafish117

Godot version:
3.2.1 and 3.2.2

OS/device including version:
Windows 10, 8Gb RAM, Nvdia Geforce 920M (Driver version 425.31), GLES3 (probably occurs in GLES2 as well)

Issue description:
The docs say to use move_and_* functions in _physics_process(), but there is an occasional jitter that happens around every 2-3 seconds. Using move_and_* in _process() however doesn't have jitter.

Steps to reproduce:
Any kind of KinematicBody2D node when moved with move_and_* in the _physics_process(), but i have included a project that shows a comparison between:

  1. move_and_slide() used only in _physics_process()
  2. move_and_slide() used only in _process()
  3. and ive also tried using Engine.get_physics_interpolation_fraction() to interpolate a KinematicBody2D that moves in _physics_process() (my code for this is based on https://www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8)

On my laptop what i see is that 1. jitters occasionally, 2. doesnt jitter at all, 3. jitters really rarely, much less noticeable than 1.

Minimal reproduction project:
Interpolation.zip

I also have Interpolation.tscn as an Autoload, which was my implementation for the interpolation fractions, I then found Engine.get_physics_interpolation_fraction() is already provided in godot for this very reason. My InterpolatedTransform2D.tscn node has a boolean that lets you switch between my implementation and the Engine's version of interpolation fraction (both of them are identical afaik).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions