Search Unity

Jelly Mesh - Soft body style physics for 3D meshes

Discussion in 'Assets and Asset Store' started by mrsquare, Mar 3, 2014.

  1. grumgrum

    grumgrum

    Joined:
    Feb 28, 2019
    Posts:
    4
    Hey man, first of all, great plugin (super easy to use)!

    One question though, I'm trying to get the Mesh scale done via script:

    Code (CSharp):
    1. JellyMesh test = GetComponent<JellyMesh>();
    2. test.m_MeshScale = new Vector3(10f, 10f, 10f);
    3.  
    4. test.RefreshMesh(); //throws an isReadable. read/write error
    5.  
    But it doesnt apply the new scale values. I've observed that the GUI is also locked when the editor is on playmode.

    Edit:
    Nvm, my bad. I saw one of your replies on a similar enquiry.

    Code (CSharp):
    1. GetComponent<JellyMesh>().Scale(scaleRatio)
    :)
     
  2. crazy_genius

    crazy_genius

    Joined:
    Jan 4, 2020
    Posts:
    17
    is it possible to make the mesh squashed when clicking on the object?
     
  3. crazy_genius

    crazy_genius

    Joined:
    Jan 4, 2020
    Posts:
    17
    nevermind i achieved that very easily
     
  4. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,487
    Please would you mind to share how?
     
  5. crazy_genius

    crazy_genius

    Joined:
    Jan 4, 2020
    Posts:
    17


    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    RaycastHit hit;

    if (Physics.Raycast(ray, out hit, 10000) && Input.GetMouseButtonDown(0))
    {
    hit.collider.gameObject.GetComponent<JellySpriteReferencePoint>().transform.position = hit.collider.gameObject.GetComponent<JellySpriteReferencePoint>().ParentJellySprite.GetComponent<JellySprite>().CentralPoint.transform.position;





    }
     
    khos likes this.
  6. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    147
    I have recently upgraded to Unity 2021.2 (from 2021.1) and the reference points' localPosition (joint.connectedAnchor) gets reset. It initialises well on start, inside JellyMesh.cs line #1059, but the value gets lost (reset to 0) immediately when the game runs. I was wondering if anyone else run into this problem?

    Thanks!
     
    Last edited: Feb 6, 2022
  7. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    147
    I think I found the culprit. It is an easy fix inside the JellyMesh.cs.
    The autoConfigureConnectedAnchor was set to false AFTER setting the position of the connectedAnchor.
    Setting autoConfigureConnectedAnchor to false before setting the connectedAnchor position makes everything OK again.

     
    WildSnakeAndy likes this.
  8. uneedtee

    uneedtee

    Joined:
    Jun 22, 2017
    Posts:
    5
    I have a JellyMesh which is working fine inside editor play mode, but when i compile the project and test it on Oculus Quest / Android the JellyMesh is not visible.
    What could possibly cause that?
     
  9. WildSnakeAndy

    WildSnakeAndy

    Joined:
    May 6, 2017
    Posts:
    2
    Works excellent!
    Thanks a lot for your research!
     
    kreso likes this.
  10. papand7

    papand7

    Joined:
    Oct 19, 2019
    Posts:
    3
    is it possible to keep the deformation on impact?
    Also is there such thing as RB.GetPointVelocity?