Godot: is_on_floor() doesn't work with _process(delta) and high FPS on trimesh collision

Created on 8 Feb 2020  路  4Comments  路  Source: godotengine/godot

Godot version:
3.2 Stable

OS/device including version:
Linux 5.5.2-arch1-1

Issue description:
If you use is_on_floor() and the kinematic body is on a on an uneven trimesh collision, is_on_floor() returns false, if you call move_and_slide() with _process(delta) AND you have high FPS.

Steps to reproduce:

  1. Create a uneven mesh.
  2. Give the mesh a trimesh collision.
  3. Place a Kinematic body
  4. Attach a script to the Kinematic body
  1. Use _process(delta) instead of _physics_process(delta)
  2. Disable VSYNC to make sure having high FPS

Minimal reproduction project:
https://github.com/JupiterRider/is_on_floor_issue

Peek 2020-02-07 17-59

bug physics

Most helpful comment

Well, it's rather expected that you need to use physics methods inside physics_process(delta).

All 4 comments

Well, it's rather expected that you need to use physics methods inside physics_process(delta).

Probably related? #35780

Well, it's rather expected that you need to use physics methods inside physics_process(delta).

I use _process for the player because the camera scrolling and player movement is smoother when moving at 100+ fps. :/

However the minimal reproduction project has me standing on_floor when standing still and only lifting off the ground when moving.

I use _process for the player because the camera scrolling and player movement is smoother when moving at 100+ fps. :/

It's probably a better idea to use _physics_process() or _integrate_forces() with lawnjelly's smoothing-addon for physics interpolation. This prevents physics from behaving differently in subtle ways depending on the rendering FPS (this will happen even if you use delta consistently).

Was this page helpful?
0 / 5 - 0 ratings