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

[Bullet] The Rigidbody cannot rotate after set the CollisionShape disabled first and enabled later #41617

Open
Tracked by #45022
PhilipWee opened this issue Aug 30, 2020 · 3 comments

Comments

@PhilipWee
Copy link

Godot version:

v3.2.1

OS/device including version:

Windows GLES3

Issue description:

Disabling collision shape results in applying torque not working
#30551
The same issue was already fixed in 2D

Steps to reproduce:

  1. Make RigidBody
  2. Disable collision
  3. Apply some nice torque impulse
  4. Watch as it does not spin

Minimal reproduction project:
RBNotRotatingMinimalReproducableProject.zip

Current Workaround:

func _ready():
	saved_collision_mask = self.collision_mask
	saved_collision_layer = self.collision_layer
	self.collision_layer = 0
	self.collision_mask = 0
	yield(get_tree().create_timer(0.2), "timeout")
	self.collision_mask = saved_collision_mask
	self.collision_layer = saved_collision_layer
@quinnyo
Copy link
Contributor

quinnyo commented Aug 30, 2020

If I understand, you are trying to apply torque to a body that has no shape/volume. According to my poor understanding of physics (engines), I think the observed result is to be expected. Or, at least, I don't think the expected outcome should involve the body rotating.

@PhilipWee
Copy link
Author

Well I guess your answer makes sense, but the issue I have with that is that when collision is disabled, apply impulse works just fine, just not applying a torque impulse

Plus it was regarded as a bug in the 2D engine, so I would expect the 3D engine to have the same behaviour

While the collision is disabled, it still should have the shape and volume of the collision shape, just without colliding with any other objects, it should still be able to move and be affected, just with no collision

@pouleyKetchoupp pouleyKetchoupp changed the title The Rigidbody cannot rotate after set the CollisionShape disabled first and enabled later [Bullet] The Rigidbody cannot rotate after set the CollisionShape disabled first and enabled later Jan 15, 2021
@rjeli
Copy link

rjeli commented Nov 26, 2021

this took me a really long time to figure out, thank you

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

4 participants