Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KinematicBody move_and_slide never slides on Plane shape #16431

Closed
TapGhoul opened this issue Feb 5, 2018 · 9 comments
Closed

KinematicBody move_and_slide never slides on Plane shape #16431

TapGhoul opened this issue Feb 5, 2018 · 9 comments

Comments

@TapGhoul
Copy link
Contributor

TapGhoul commented Feb 5, 2018

Godot version: Godot 3.0 Stable

OS/device including version: Arch Linux

Issue description:

Move and slide totally fails to move, at least when on a plane collision
As a bonus, move_and_collide never returns what it collided with

Steps to reproduce:

  1. Create plane collision (static body)
  2. Create KinematicBody cube
  3. Move cube above plane
  4. move_and_slide(Vector3(1, -1, 0))
  5. Cube stops when hitting the floor, other functions reporting collides/slides/etc show 0 done
  6. Switch to move_and_collide, print return value, notice that it returns null always

Minimal reproduction project:

MoveSlideBug.zip

Extra notes:
Speculation: move_and_slide breaks due to move_and_collide never returning a collision, so it thinks it's done sliding, causing the rest of the kinematic physics to break down

@eon-s
Copy link
Contributor

eon-s commented Feb 5, 2018

Seems to be related to #5910 which may correspond to move_and_collide now, also there are mentions that test_move does not work with planes which may be closer to the root of the problem.

@TapGhoul
Copy link
Contributor Author

TapGhoul commented Feb 5, 2018

Seems like it. Wish they'd warn somewhere.

@ghost ghost added this to the 3.1 milestone Feb 5, 2018
@fracteed
Copy link

fracteed commented Feb 6, 2018

Although I haven't looked at your file, it sounds similar to the issues I am having with my shooter game. When the player and npc's touch a floor/wall in my game, they will tend to come to a stop fairly abruptly, rather than sliding. The same code with native Godot physics slides perfectly. I was going to try and recreate this issue with a simple scene, but it seems like @Silvea12 has done so here.

@TapGhoul
Copy link
Contributor Author

TapGhoul commented Feb 6, 2018

@fracteed It seems like it only applies to the plane. As a plane has no thickness, bullet seems to not like it so much (or whatever handles kinematic move_and_collide) so it returns nothing.

The stop is in relation to the fact that move_and_slide calls move_and_collide before sliding, and will return immediately if no collisions were hit - i.e. it assumes no slide needs to be performed. This is as if it stopped in mid air, seeing no reason to continue trying to adjust itself.

@fracteed
Copy link

fracteed commented Feb 7, 2018

Maybe it is a different issue. I only use box shape collisions and have never even tried the plane collision. Regardless, I am still getting very glitchy sliding using Bullet. However my kinematic bodies are travelling quite fast, so this may be a factor. The native godot physics slides perfectly in the same instance, but bullet kinematic bodies catch all the time, so I am using some very hacky code to force bodies away from collision shapes to try and avoid this!

Does your issue go away if you change from Bullet to native godot physics?

@fracteed
Copy link

fracteed commented Feb 7, 2018

Not sure if they are related or not, but I have added my issue here #16459

@AndreaCatania
Copy link
Contributor

This is not a bug, The plane shape is not mean to be a walkable floor

@eon-s
Copy link
Contributor

eon-s commented Sep 7, 2018

@AndreaCatania can it be possible to add a warning when a PhysicsBody/2D has a plane (or line) shape?

@akien-mga akien-mga changed the title KinematicBody move_and_slide never slides (with move_and_collide broken bonus) KinematicBody move_and_slide never slides on Plane shape Sep 10, 2018
@akien-mga
Copy link
Member

Closing as it's the same issue as #17893, where a potential enhancement is discussed.

@akien-mga akien-mga added archived and removed bug labels Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants