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 should allow the node to sleep in Character mode if "can_sleep" option is checked #17336

Closed
exts opened this issue Mar 7, 2018 · 3 comments
Labels

Comments

@exts
Copy link
Contributor

exts commented Mar 7, 2018

Godot version:
3.0.2

OS/device including version:
Windows 10

Issue description:
Currently it seems like the only way to stop a rigidbody2d from rotating when falling is to put it in 'Character' mode and that's fine, but the moment you put it into character mode the ability to sleep doesn't exist. I found that this is normal in #7996

What would you like to happen instead?
I would love it if the "can_sleep" option is set to true then in character mode the sleeping works how you would expect it to just without the rotation when gravity is involved.

@exts
Copy link
Contributor Author

exts commented Mar 7, 2018

Or maybe add a new mode with this functionality?

@ShyRed
Copy link
Contributor

ShyRed commented Mar 7, 2018

You can prevent a RigidBody2D from rotating by implementing the _integrate_forces method ( see http://docs.godotengine.org/en/3.0/classes/class_rigidbody2d.html#class-rigidbody2d-integrate-forces ) and setting the state parameter's angular_velocity to zero and/or even set the transform's rotation to a constant value.

@exts
Copy link
Contributor Author

exts commented Mar 8, 2018

@ShyRed closing for now. That alternative sort of works, but not really

@exts exts closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants