Search Unity

Jelly cube

Discussion in 'Editor & General Support' started by Risine, Jan 11, 2019.

  1. Risine

    Risine

    Joined:
    Dec 10, 2009
    Posts:
    130
    Hi everyone,

    I'd like to know how to make a jelly cube.
    From what I read here and there, the best way is to use bones on a cube, then attach them to some spring joint.
    But how can I do that?
    1/ Can I create bones in unity or do I have to use some other software like 3dsMax?
    2/ How do you attach a bone to a spring point/object?
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,701
    Unless there's some Asset Store purchase you can make, I expect you'll need to go outside of Unity in order to rig up your model. The reason being, the bones need to be associated with vertices in your model, and I don't think you can set up blend weights in Unity.

    Blender's a good free choice to try out.Create a cube, add some bones, and start weight-painting to associate the bones to the different faces in your cube. Then export an FBX and bring that FBX into Unity.

    At that point, you can add a Rigidbody to each bone in Unity, and then create joints connecting the rigidbodies.

    Or maybe look at the project this guy made, and get some ideas:
     
  3. ERisine

    ERisine

    Joined:
    Mar 3, 2017
    Posts:
    7
    thanks for your reply dgoyette,
    I got the jelly cube test project, it works fine, thanks to that I don't have to learn blender ... for now :)

    Now I'm facing another problem, I'd like to make that jelly cube object a child of another basic object, to make the cube behave as any normal transform child, but with it's jelly properties(working in 'local' space).
    But it seems physics does not work that way. As soon as I do that, I've got my joints behaviing weirdly, doing strange stuff, like going all around.

    How can you "make physics relative to parent"?
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,701
    I don't know if there's a simple solution. I definitely run into weird physics issues if I try to nest rigidbodies, or place an object's rigidbody on a parent and its collider on a child (or vice versa). So, it's possible the answer is that you just can't do that. Try to make sure your rigidbody and colliders are components of the same object, not separate by parent/child relationships.