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 doesn't wake a sleeping RigidBody after collision #25857

Closed
dam482 opened this issue Feb 13, 2019 · 4 comments
Closed

KinematicBody doesn't wake a sleeping RigidBody after collision #25857

dam482 opened this issue Feb 13, 2019 · 4 comments

Comments

@dam482
Copy link

dam482 commented Feb 13, 2019

Godot version:
v3.1.beta4.mono.official

OS/device including version:
Windows 10

Issue description:
If a KinematicBody collides with a sleeping RigidBody, using the MoveAndSlide method, and the KinematicBody does NOT have infinite inertia, the sleeping RigidBody will never wake up.

Looks like this was already fixed for the case where the KinematicBody DOES have infinite inertia, with #18138

Steps to reproduce:

  1. Load attached project into editor and run it.
  2. Wait a few seconds for the red box to fall asleep.
  3. Use the mouse and WASD keys to collide the player with the red box.
  4. Notice the red box doesn't move at all.
  5. Exit game and return to the editor, and disable the "CanSleep" property of the "Box" object.
  6. Run again, and notice when the player collides with the red box, the box will now move.

Minimal reproduction project:
KinematicBodyTest.zip

@dam482 dam482 changed the title KinematicBody not waking a sleeping RigidBody during collision KinematicBody doesn't wake a sleeping RigidBody after collision Feb 13, 2019
@akien-mga akien-mga added this to the 3.2 milestone Feb 13, 2019
@Amssat221
Copy link

We are a team working on this project for a CS class. Could we get assigned to this issue. Our uusernames are gsegovia2018,mattintriago,cniefit,amssat221

@raymoo
Copy link
Contributor

raymoo commented Feb 15, 2019

@Amssat221 You don't need to be assigned, just submit a pull request with the changes.

@madmiraal
Copy link
Contributor

This issue is highlighting something different to the one described. It's not that the RigidBody doesn't move after it goes to sleep. The issue is that the RigidBody shouldn't be moveable before it goes to sleep.

The current documentation for the KinematicBody move_and_slide() method states:

If infinite_inertia is true, body will be able to push RigidBody nodes, but it won’t also detect any collisions with them. If false it will interact with RigidBody nodes like with StaticBody.

By setting infinite_inertia to false, the RigidBody is told to behave like a StaticBody when the KinematicBody move_and_slides (or move_and_collides) into it. This is the behaviour after the RigidBody goes to sleep. See the Kinematic to RigidBody Interaction tutorial for more information.

So the real question is: why is this RigidBody not behaving like a StaticBody when a KinematicBody using the MoveAndSlide() method with infinite_inertia set to false collides with it?

@akien-mga
Copy link
Member

Closing as duplicate of #31981.

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