godot icon indicating copy to clipboard operation
godot copied to clipboard

DampedSpringJoint2D doesn't respect max length/distance

Open stephanbogner opened this issue 1 year ago • 0 comments

Godot version

v4.0.stable.official [92bee43ad]

System information

Ubuntu, Godot Forward+

Issue description

Issue:

  • The documentation about DampedSpringJoint2D states that length is "The spring joint's maximum length. The two attached bodies cannot stretch it past this value.".
  • This doesn't seem to be true, as also this old Reddit post indicates (which states it's the initial distance or length, not the max length).

Test setup:

  • Two rigid bodies are exactly 100px apart
  • The spring is connected to both bodies and the max length is set to 100px
  • When they fall down due to gravity, the "mountain" shoves them apart much further than the specified distance
  • Expected behaviour: The bodies stay close to the top of the mountain due to the spring's max length

image

image

Conclusion: Maybe this is just a mistake in the documentation or it really is a bug. If it's a documentation issue it would be great to have max length as a feature.

Steps to reproduce

  1. Create two RigidBody2D
  2. Create DampedSpringJoint2D connected to the bodies
  3. Set a max and rest length
  4. Create situation where the bodies move away from each other (it helps upping the weight of the bodies)
  5. See distance becoming greater than max distance

Minimal reproduction project

Bug-SpringJoint.zip

stephanbogner avatar Mar 10 '23 14:03 stephanbogner