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

Time scale affects PinJoint2D's softness #5418

Closed
Tracked by #45334
timoschwarzer opened this issue Jun 25, 2016 · 13 comments
Closed
Tracked by #45334

Time scale affects PinJoint2D's softness #5418

timoschwarzer opened this issue Jun 25, 2016 · 13 comments

Comments

@timoschwarzer
Copy link
Contributor

timoschwarzer commented Jun 25, 2016

Operating system or device - Godot version:
Linux 64 bit, 2.0.3

Issue description (what happened, and what was expected):
When I have a RigidBody2D connected to StaticBody2D using a PinJoint2D which has softness > 0, and then playing around with OS.set_time_scale(), the connected RigidBody hinges around. I don't think the time scale should affect the softness of a PinJoint2D.

@reduz
Copy link
Member

reduz commented Jul 7, 2016

if you could make a simple demo scene, it would be very appreciated

@timoschwarzer
Copy link
Contributor Author

gd-pinjoint-timescale.tar.gz
@reduz here you are ;-)
Just let the bodies fall down on the platform, the set the time scale to 0.5 or 0.25. You'll see the platforms going up.

@bojidar-bg
Copy link
Contributor

Pretty bump, what is going on with this issue, any workarounds, is it still valid, etc..

@timoschwarzer
Copy link
Contributor Author

I will try if the current master compiles and works...

@timoschwarzer
Copy link
Contributor Author

timoschwarzer commented Jan 12, 2017

@bojidar-bg Yes, this issue is still valid and there doesn't seem to be a workaround for it.

@bojidar-bg
Copy link
Contributor

@timoschwarzer Thanks for confirming!

@timoschwarzer
Copy link
Contributor Author

Has this been fixed in 3.0?

@pwab
Copy link

pwab commented May 2, 2020

Hey @timoschwarzer I tried to reproduce this issue with your sample file. Because the issue is very old the demo scene had to be updated. What I changed to make it work with Godot 3.2.1:

  • Updated to newest project.godot
  • Changed Scene from Node to StaticBody so the PinJoints are able to work with it
  • Changed OS to Engine because time_scale moved there

Then I was able to run it and it seems that there is no issue with softness anymore. I'm not sure if my updates changed the way the demo scene worked so would you look into it again and confirm that the issue is not present anymore? Here is the updated project:
gd-pinjoint-timescale.zip

I'm also working on Windows 10 x64 right now. Not sure if this can still be reproduced on Linux machines.

@madmiraal
Copy link
Contributor

@pwab Thanks for updating the minimal reproduction project. In the original project, the Default Gravity is set to 980. If you set the Default Gravity to 980, you will notice the issue described.

For everyone's convenience, I've updated @pwab's project with the Default Gravity set to 980, to show that the issue still exists in 3.2.2:
gd-pinpoint-timescale.zip

@pwab
Copy link

pwab commented Aug 31, 2020

Hey @madmiraal thanks for making this clear. I haven't looked into your updated project yet but if this is a gravity + time_scale thing maybe it is somehow related to #6323?

@Calinou
Copy link
Member

Calinou commented Mar 5, 2022

I tried to adjust the softness depending on time scale in the project, but it doesn't appear to be a linear relationship. I let the RigidBodies rest for ~15 seconds on each run:

Time scale 1.0 with softness = 10

2022-03-05_22 06 07

Time scale 0.5 with softness = 10

2022-03-05_22 06 25

Time scale 0.5 with softness = 20

The inspector limits PinJoint2D softness to 16.0, so this must be done with a script.
Notice the height difference compared to time scale 1.0 is lessened, but it's still present.

2022-03-05_22 07 29

@pwab
Copy link

pwab commented Jun 21, 2023

This issue is still valid in Godot 4.1 (beta 2) with Godot Physics. It more or less can be summarized that all parts of the physics engine are affected by a Engine.time_scale other than 1 (especially above 1). This was discussed in #24334 and there might be a fix with #30798.

I just wanted to drop that here because I noticed that this issue is still open and was not mentioned in #30798. @Calinou maybe this issue could be closed as duplicate in favor of #24334?

@Calinou
Copy link
Member

Calinou commented Jun 21, 2023

Closing in favor of #24334.

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

6 participants