Slime behaves strangely when jumping

Made a character with slime physics. When I jump, the slime behaves strangely. It starts spinning in different directions. interpolate disabled.

jump code:

private void Jump()
{
    //if (view.IsMine)
    {
        rb.linearVelocity = new Vector3(rb.linearVelocity.x, 0f, rb.linearVelocity.z);

        rb.AddForce(jump * jumpForce, ForceMode.Impulse);
    }
}

Slime (1)

We need to better understand how you created that slime ball. Is it a sphere of jointed sphere colliders?

PS: you can use the Unity Recorder package to create videos directly from within the editor.

3 Likes

How does your slime physics work? If you made the script for it, meaning you have control over the points and their velocities, then just have the jump method loop through the points and set their velocities up. If not, what library/components are you using?

2 Likes

(I don’t know if it’s possible to insert links here, but I’ll try.) I just watched this tutorial and did exactly the same thing.

Could you post a screenshot of the Inspector for the ball and if they are separate, for one of the spheres inside?

To what body do you apply the force? My hunch is that you will want to apply the force equally to all parts of the ball, not just the center object because this will otherwise drag the inner spheres behind and might cause them to spin.

Also on the joint, “enable collision” should either be off or the setup needs to leave a little space between each sphere collider, they must not touch or even intersect.

Are you talking about this?

Yes. I suppose the wobble is mainly due to accelerating the main (center) body. This forces the spring joints to follow, thus adding several more forces on the slime which, when they interact, cause the slime to wobble to some degree.

Try applying the same jump force to each Rigidbody on Player and its children so they all move uniformly in the same direction.

How can I implement this? How can I get all rigidbody objects?