Animating SpringJoint locations doesn't change the calculated location point

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Takanu Kyriako
:warning: Old Version Published before Godot 3 was released.

Hey, I’m trying to create a SpringJoint system for my 2D UFO Grabber-style game in order to apply tension to the claw, and I’m currently trying to achieve this by moving the Spring location to redirect the direction that the claw is currently pointing towards.

Although i’m sure there’s other ways I could achieve this, trying to animate the position doesn’t work at all - the joint maintains the spring location set from the editor.

Is this a bug or a feature? Does anyone have any other potential solutions for achieving the same effect? (Im considering trying to apply two different springs to the same joint in different directions, that then alter their stiffness to get the claw to rotate).

:bust_in_silhouette: Reply From: avencherus

It’s been my experience that using animation will usually suspend physics bodies and treat the movements as kinematic, until the animation completes. You can see this for yourself if you animate a rigid body.

Without full knowledge of your project, I would venture to say you’ll have to manage the motion for these things inside of the fixed_process() or integrate_forces() functions if you want the physics simulations to continue processing.

To answer the question, it’s by design that animations and the physics system don’t intermingle.

I’d have agreed with that, but when the animation is completed the location of the spring still doesn’t change when according to your description it seems like it should be able to. I’m currently using fixed_process for some animation though and will look into integrate_forces() :slight_smile:

Takanu Kyriako | 2016-11-20 18:36

Hmmm yeah, I it is a bit unclear for joints specifically, but they definitely don’t animate at all, even though it appears that way in the editor. They can only be moved via script. I haven’t tested though how robustly they function however.

The joint and constraint system is functional, but seems a fair bit underdeveloped for the time being.

avencherus | 2016-11-20 18:50

Seems like it, at least there’s some workarounds though - using two springs in different positions and alternating their stiffness creates a similar effect.

Thanks for the response though!

Takanu Kyriako | 2016-11-21 06:19