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

Rigidbody2D never sleep if they are "characters" #7996

Closed
SuperiorHobo opened this issue Mar 9, 2017 · 5 comments
Closed

Rigidbody2D never sleep if they are "characters" #7996

SuperiorHobo opened this issue Mar 9, 2017 · 5 comments

Comments

@SuperiorHobo
Copy link

SuperiorHobo commented Mar 9, 2017

Operating system or device - Godot version:
Godot - 2.1 or 2.0/ windows 7

Issue description:
I put some 2d Rigidbodies with "character" mode in scene, they have no any forces applied to them, but debugger show this objects as "active" (with "rigid" mode they sleep and become non active just fine)

Steps to reproduce:
create RigidBody2D with Character mode and zero gravity, watch in monitoring window how it not sleep. Then change mode on Rigid and watch youre have -1 active body

@27thLiz
Copy link
Contributor

27thLiz commented Mar 9, 2017

Mhh this seems to be meant as a feature, not a bug :P

//Body2DSW::sleep_test
else if (mode==Physics2DServer::BODY_MODE_CHARACTER)
	return !active; // characters and kinematic bodies don't sleep unless asked to sleep

@SuperiorHobo
Copy link
Author

SuperiorHobo commented Mar 9, 2017

why? if i want to make them sleep by manual i just can switch off "can sleep" func

@kubecz3k
Copy link
Contributor

Yes by design characters should not sleep unless they are explicit asked to, since quite often their logic is processed inside _integrate_forces.

@razcore-rad
Copy link
Contributor

Yeah, this doesn't make any sense to me either. As I understand it, even if _integrate_forces() is implemented the physics server still runs collisions and movement on the object unless custom_integrator is true.

I think sleeping should be managed by the server as long as can_sleep is on and custom_integrator is off as well, but not when custom_integrator is on perhaps.

This definitely needs to be documented better.

@Calinou
Copy link
Member

Calinou commented Aug 30, 2021

This was resolved in 4.0 as part of #48908. The change can't be backported to 3.x to preserve compatibility with existing projects, but this caveat is now documented.

@Calinou Calinou closed this as completed Aug 30, 2021
@Calinou Calinou added this to the 4.0 milestone Aug 30, 2021
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