Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Jelly Sprites - Soft body sprite physics system

Discussion in 'Assets and Asset Store' started by mrsquare, Dec 5, 2013.

  1. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    13
    Thanks! Updated to 5.5 and the problem gone
     
  2. dergachoff

    dergachoff

    Joined:
    Aug 7, 2015
    Posts:
    4
    Hi, @mrsquare!

    You've made a really great asset! But I've stumbled upon an issue. When I set JellySprite mode to Grid through inspector, I get no gizmos in the scene and the following error in the console:

    NullReferenceException: Object reference not set to an instance of an object
    JellySprite.OnDrawGizmosSelected () (at Assets/Plugins/JellySprites/Scripts/JellySprite.cs:2406)
    UnityEditor.DockArea:OnGUI()

    I'm using Unity 5.5.1.f1
    Any ideas how to fix it?

    Thanks!
     
  3. dergachoff

    dergachoff

    Joined:
    Aug 7, 2015
    Posts:
    4
    Also: any way to add a 2d joint (like a hinge joint) to the central (or any other) body?
     
  4. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - sorry for the slow reply. Hm, that's odd - I'm on a slightly earlier version, but not seeing that. Let me upgrade to 5.5.1.f1 and give it a try.

    Re. adding a joint to the Jelly Sprite - you'd have to do that programatically due to the reference points being created at runtime, but you'd just need a bit of code like this:

    Code (csharp):
    1.  HingeJoint2D joint = GetComponent<JellySprite>().CentralPoint.GameObject.AddComponent<HingeJoint2D>();
    Or alternatively, set up your hinge joint in the inspector and then just attach it to the central Jelly Sprite body at runtime.
     
  5. smasters654

    smasters654

    Joined:
    Dec 20, 2013
    Posts:
    28
    Hi @mrsquare

    I sent you an email about you jelly mesh asset regarding 2 materials on an mesh a bit ago but I haven't heard from you. I would have posted this in the jelly mesh forum post but it seemed pretty dead on there sorry. Please let me know how to fix this issue? Thanks!
     
  6. kapopixel

    kapopixel

    Joined:
    Apr 2, 2017
    Posts:
    32
    Hi @mrsquare

    Is it possible for you to clarify how to add distance joints or hinge joints etc. to jelly sprites? It would be great. Thanks.
     
    Last edited: Nov 20, 2017 at 10:16 AM
  7. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - sorry for the slow reply.

    So, from a script attached to the Jelly Sprite, you can access the Jelly Sprite reference points like this:

    Code (csharp):
    1. JellySprite jellySprite = GetComponent<JellySprite>().ReferencePoints[x];
    Reference points are the physics objects that control the Jelly Sprite behaviour - you'll have a different number depending on what configuration you're using. The one at index 0 is always the central reference point, and the others will be attached to that.

    The reference point itself is just a little data structure that contains a gameobject and some other info. So to add a distance joint, you just add a DistanceJoint2D component to the reference point gameobject as you would with any other gameobject:

    Code (csharp):
    1. // Get the Jelly Sprite component
    2. JellySprite jellySprite = GetComponent<JellySprite>();
    3.  
    4. // Get the reference point gameobject (pass in an index from 0 -> jellySprite.ReferencePoints.Count)
    5. GameObject jellySpriteReferencePointObject = jellySprite.ReferencePoints[0].GameObject;
    6.  
    7. // Add a new distance joint
    8. DistanceJoint2D distanceJoint = jellySpriteReferencePointObject.AddComponent<DistanceJoint2D>();
    9.  
    10. // Configure the distance joint
    11. distanceJoint.connectedBody = someOtherRigidBody;
    12. ...
    13.  
     
    kapopixel likes this.
  8. Goodyearpimp

    Goodyearpimp

    Joined:
    Jun 5, 2014
    Posts:
    3
    I've purchased both JellyMesh & JellySprite recently (great work by the way MrSquare).


    I was hopeful that I could use this in tandem with SVG Importer from the Asset Store (Jarolic's). I am unable to use either JellyMesh or JellySprite with the Unity MeshRenders or MeshFilters generated automatically when importing SVGs through his asset. Any help???
     
  9. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - sorry, I'm not familiar with that asset (and sadly is a bit pricey for me to give it a test!). If you could send me an example project containing some meshes you've used it to generate, then I might be able to diagnose the issue.
     
  10. jooyeon0103

    jooyeon0103

    Joined:
    Sep 26, 2017
    Posts:
    1
    Hello,

    I instatiated many Jelly Sprite from PinkBlob in demo scene.
    I make prefabs, and instantiate from code.

    But some PinkBlob instance have been teared. I attached a screen shot and marked red box.
    How can I avoid this sprite error?

    Thank you.
     

    Attached Files:

  11. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - sorry for the slow reply.

    Its hard to tell without seeing it in motion, but judging by the screenshot it looks like some of the bodies are getting stuck on something and/or getting a very large force applied to them, which is causing them to move far away from their default formation. Assuming that you don't have any invisible platforms or anything in your scene that they're getting stuck on, you could try increasing the collider radius, or maybe using the 'Attach Neighbors' options, both of which should help them keep their shape a bit better.

    Having said that, that is a very large number of physics bodies + springs that you have in a confined space, so it could just be the physics engine freaking out! Might be worth reducing the number of Jelly Sprites and/or bodies per Jelly Sprite, if that is an option.
     
  12. Guideborn

    Guideborn

    Joined:
    Jun 15, 2013
    Posts:
    212
    Will the Jelly Sprites jiggle by only moving them around (dragging) without collision? I want the jiggle effect this system has, but never having to collide with any terrain or objects.
     
  13. HyunMok_Moon

    HyunMok_Moon

    Joined:
    Oct 14, 2016
    Posts:
    2
    Hello mrsquare,

    I want to change tint color in UnityJellySprite component.
    I changed m_Color value in runtime.

    from JellySprite.cs
    // Tint color
    public Color m_Color = Color.white;

    from my code,
    transform.GetComponent<UnityJellySprite>().m_Color = new Color(1f, 1f, 1f, 0.5f);

    I can see "Tint Color" value is applied in Inspector window.
    But sprite image is not change in Game view.
    When I change from Inspector, Tint Color in UnityJellySprite component I can see in Game view.

    I changed Alpha value.

    renderer.sharedMaterial.SetColor("_TintColor", colorValue)
    it work neighter.

    Thank you.


    I resolved.
    Sprites/Default shader, use _Color property as Color: Tint. so I changed _TintColor -> _Color
    it works!!
     
    Last edited: Nov 7, 2017
    mrsquare likes this.
  14. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - yeah, you can turn off the collision on the Jelly Sprite colliders, that shouldn't be a problem (or else just put them into a layer that has no collision).
     
  15. kapopixel

    kapopixel

    Joined:
    Apr 2, 2017
    Posts:
    32
    Hello @mrsquare ,

    Have you tested mobile performance of Jelly Sprites lately ? I saw your answer about performance on iPhone4 but it is from May 2014.

    I am using one Jelly Sprite character containing 18 custom bodies with default vertex density settings (10) and wondering if it is OK for devices like iphone 6s and above. I think 18 active bodies mean 36 joints but have no idea what this means in terms of mobile performance. Any idea or experience you can share?

    Thanks a lot.