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

RigidBody won't unfreeze when starting frozen. #242

Closed
DragonController opened this issue Aug 30, 2024 · 3 comments · Fixed by #258
Closed

RigidBody won't unfreeze when starting frozen. #242

DragonController opened this issue Aug 30, 2024 · 3 comments · Fixed by #258
Labels
bug Something isn't working

Comments

@DragonController
Copy link

DragonController commented Aug 30, 2024

Describe the bug

When a RigidBody is set to be frozen when you first run a project, you can't unfreeze it.

To Reproduce

Make a RigidBody and set it to be frozen (I also set it so it can't sleep). Attach a script to the RigidBody that allows you to toggle if it is frozen (I set it to the F key). Unfreezing the RigidBody does not appear to do anything (the RigidBody is unaffected by gravity and my script to move it with the A and D keys does nothing). However, if you start the RigidBody as unfrozen, the script works as expected.

Add steps here

Expected behavior

I expect that when a RigidBody starts frozen and then is unfrozen, it would act the same way as if it starts unfrozen.

Environment:

  • OS: Windows
  • Version: v0.8.2
  • Godot Version: v4.3
  • Type: Cross Platform Deterministic Single 2D

Example project(zip)

bug-testing.zip

@DragonController DragonController added the bug Something isn't working label Aug 30, 2024
@Teufelauto
Copy link

I can confirm that this effects 3d, as well.

My example has one cube that is frozen and one that is not, suspended in air. Running causes expected behavior, but clicking button that sets frozen to false changes checkbox in Inspector, but cube remains suspended. There is another bug illustrated in the file, for which I will open its own issue.

Environment:

OS: Windows
Version: v0.8.2
Godot Version: v4.3
Type: godot-rapier-3d-single-simd-parallel

Example project(zip)
rapier_lock_rotation_test.zip

@Teufelauto
Copy link

Teufelauto commented Sep 7, 2024

Edit

Unfreezing in Scene, and freezing in the Script works as a band-aid if starting a new project...

I'm having more problems with migrating than I had hoped. Dice just jitter after being thrown, and never sleep. idk. Not working with default physics, either. lol.

Original

I am going to have to work around this issue, so, unfreeze all my movable objects and put freeze in the _ready() function, because I'm up against a bug in 0.7.27 that would require me to destroy my instance after every dice throw to reset behavior to normal.

I've been using 0.7.27 to avoid this freeze bug, but ran into an angular momentum bug where throwing dice repeatedly gave them more and more spin-down time with each throw.
This was fixed, because 0.8.2 works in my above test (after giving it some spin and some collision boundaries), but 0.7.27 has the accumulating spin issue.

I'm glad my project only has 11 movable objects.

@Ughuuu
Copy link
Contributor

Ughuuu commented Sep 23, 2024

Issue is that when the body changes mode, it doesn't have any property anymore. I am applying all properties, same as if the body is changing space, and this fixes it. I have a PR linked to this that will fix it.

Ughuuu added a commit that referenced this issue Sep 24, 2024
…collisions. (#258)

Adds some ComplexField functions for determinism. Follows
#226
- Fixes #242
- Fixes #250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants