godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.36k stars 20.01k forks source link

[Bullet] move_and_slide_with_snap inconsistent is_on_floor #34081

Closed grevius5 closed 1 month ago

grevius5 commented 4 years ago

Godot version: 3.1 >

OS/device including version: Linux Manjaro

Issue description: I have a simple gridmap and kinematicbody, if my body stands exactly between 2 tiles with collision the is_on_floor() value jumps to True and False and makes the state inconsistent. If I'm on a tile (not near the edge) the is_on_floor() value is correct.

Steps to reproduce: Create gridmap with a simple cube (1x1x1) and collision. Create a map and set the kinematic body at (0, 0, 0).

Miziziziz commented 4 years ago

Are you applying a downward force (like gravity) before calling is_on_floor?

grevius5 commented 4 years ago

yes, I apply gravity to the velocity vector, but the problem was that I was using the FLOOR_VECTOR as (0, 1, 0) and the SNAP_VECTOR to (0, 1, 0), settings the snap vector y to negative value seems to work correctly. Now I have some problem with the wall collision if I have a velocity pointing a wall, move_and_slide_with_snap returns to me a velocity != 0 in the direction of the wall and not 0. An example velocity.x = -1 and I'm attached to a wall, move_and_slide return me -1 as x velocity and not 0

Sslaxx commented 4 years ago

The snap thing sounds a bit like #34098?

pouleyKetchoupp commented 3 years ago

Can be still reproduced in 3.2.4 beta 5, but occurs only when using Bullet Physics (default settings). Switching to Godot Physics 3D fixes the issue.

akien-mga commented 2 years ago

Is this still reproducible in 3.5 RC 1 or later? If so, could someone provide a minimal reproduction project to make this easier to test?

AThousandShips commented 1 month ago

Closing due to lack of response, if you provide the requested information this can be reopened