- Home /
Question by
Haerius · Feb 14, 2016 at 02:35 PM ·
physics2dresetspringjoint
Reset a softbody2D
I have a 2D "softbody" as the player character, which is made out of many circleCollider2D's
and springJoint2D's
. Since the respawning of the player can happen very often, I decided to play it smart and don't instantiate him every time, but to reset the softbody, which turned out to be tricky. I reset the transform and the Rigidbody.velocity
manually, which is fine, but there is no way to reset a springJoint2D. This causes the caracter to wobble after the respawn.
My current solution is:
float temp = joint.frequency;
joint.frequency = 0;
yield return new WaitForSeconds(0.5f);
joint.frequency = temp;
But this is obviously very dirty.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612064151im_/https://answers.unity.com/themes/thub/images/avi.jpg)