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. aerandir92

    aerandir92

    Joined:
    Dec 4, 2014
    Posts:
    6
    I noticed something weird today with JellySprites

    Have been working on a project for some months now where we ended up using JellySprites for our main character
    We have been working in Unity Free all the time

    But a week or so ago I started the Pro trail just to check it out
    Today we moved the project from Github to Bitbucket and after I cloned it down from Bitbucket and opened the project in Unity Pro, JellySprites behaved quite significantly different. First I thought that there were some weird bugs in my old file, I started doing the changes needed to get the size of it and behaviour close to what it was before.

    When the rest of the group noticed, they didn't feel comfortable (we have a presentation of it tomorrow) about the big change and told me to change it back. First I just told them I couldn't 'cause I had no idea how it happened, but after they kept on nagging for a while I got one theory, it could have something to do with Unity Pro
    So I cloned the project again into a new location, ended my Unity Pro trail and then opened the project, and tadda! back to what we were used to

    So the one thing worth noticing here is that what ever the different is, it is something that is generated when opening the project when missing certain files that is not uploaded with Git

    Have you any idea what the difference here is? I took a backup of the folder with the project were the Unity Pro JellySprite is so that we can look into it later, for now I have rolled back to what we had before

    .gitignore file: http://pastebin.com/6pu2B67A

    Edit: Something more came up that might be relevant
    We all started the project while using the Unity 4.6 beta (wanted the GUI stuff)
    Though one person in the group didn't get that note and just downloaded 4.5
    I just remembered that when she opend the project, the JellySprite was much bigger then on ours. I just told her to download 4.6 not thinking that 4.6 could be the problem and not 4.5

    If it is a bug with Unity 4.6 it isn't in the Pro version, but is still in the Free version as I could fix the 'problem' be just re-cloning and the open in the Free version
    Isn't that a bit odd?
     
    Last edited: Dec 9, 2014
  2. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - that is quite weird, sorry to hear that it has been causing you problems. I personally run with Unity 4.5 (Pro) - I've not downloaded 4.6 just yet, so all my recent Jelly Sprites work has been done on various versions of 4.5.

    Theoretically, there shouldn't be any difference between the Pro and Free versions, although Unity does have a nasty habit of silently disabling certain features if you're running the Free version (eg. the graphics stencil buffer just magically stops working with no warning messages of any kind). However, I'm not aware of any physics-based differences between Free and Pro (which I'd assume would be the most likely cause of things breaking here). Differences between 4.5 and 4.6 would be more likely to cause errors like this (especially if the 4.6 build is a beta version).

    But yeah - sorry, nothing immediately comes to mind that might cause this. I'll try to put aside a bit of time this weekend to test everything out on 4.6 Pro/Free and see if I can spot any issues. I'd be interested to hear if you can recreate this problem in the Jelly Sprites demo scene.

    One thing to note - if you're cloning projects by just copying folders around, its generally best to not copy the 'Library' folder, nor any of the .meta files that exist in the Asset folder. Unity will regenerate all of that stuff itself when you load the project, and having old data from another compute/version of Unity can cause issues. Might be worth trying if you're not doing that already.
     
  3. aerandir92

    aerandir92

    Joined:
    Dec 4, 2014
    Posts:
    6
    Thanks for the answer!

    I will do a test after my final exam (it's friday), probably sometime next week were I test to see how it behaves in Unity 4.5. I will upload different builds on the versions so you can see the differences for yourself
     
  4. aerandir92

    aerandir92

    Joined:
    Dec 4, 2014
    Posts:
    6
     
  5. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,163
    Sorry if this has been asked, but can I use this on 3D objects like a sphere?
     
  6. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Check out Jelly Mesh - it's the same basic concept as Jelly Sprites, only for 3D objects :)
     
    maltadirk likes this.
  7. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,163
    Awesome.
    Thanks!!!
     
  8. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    562
    Hi mrsquare,

    I released my game a few months ago now for which I used JellySprites to create it! Without JellySprites I would never have been able to create my game!

    The game is called Save the Jollies, and its available for FREE on both iOS and Android, checkout www.SavetheJollies.com for more info! :)

    [​IMG]

    I noticed that you have released an update in the Asset Store only yesterday, its great to see your still actively developing this great asset!

     
  9. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Excellent, thanks for sharing Greg :) Always nice to see how people are using my assets, I'm glad it came in useful!
     
  10. devjo

    devjo

    Joined:
    Jan 20, 2015
    Posts:
    1
    I read this post and replys.

    But I didn't understand how to detect collision with jelly sprite.

    Can you tell me step by step?

    How can I use this?

    public void OnJellyTriggerEnter(JellyCollision collision)
    {
    debug.log("r");
    }

    -> The type or namespace name 'JellyCollision' could not be found. Are you missing a using directive or and assembly reference?
     
  11. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - you've almost got it correct, but the syntax is slightly wrong. Just choose one of these depending on what you're trying to detect:


    Collisions using 3D physics system
    Code (csharp):
    1. public void OnJellyCollisionEnter(JellySprite.JellyCollision collision)
    2. {
    3. }
    4.  
    5. public void OnJellyCollisionStay(JellySprite.JellyCollision collision)
    6. {
    7. }
    8.  
    9. public void OnJellyCollisionExit(JellySprite.JellyCollision collision)
    10. {
    11. }

    Collisions using 2D physics system
    Code (csharp):
    1. public void OnJellyCollisionEnter2D(JellySprite.JellyCollision2D collision)
    2. {
    3. }
    4.  
    5. public void OnJellyCollisionStay2D(JellySprite.JellyCollision2D collision)
    6. {
    7. }
    8.  
    9. public void OnJellyCollisionExit2D(JellySprite.JellyCollision2D collision)
    10. {
    11. }

    Triggers using 3D physics system
    Code (csharp):
    1. public void OnJellyTriggerEnter(JellySprite.JellyCollider collider)
    2. {
    3. }
    4.  
    5. public void OnJellyTriggerStay(JellySprite.JellyCollider collider)
    6. {
    7. }
    8.  
    9. public void OnJellyTriggerExit(JellySprite.JellyCollider collider)
    10. {
    11. }

    Triggers using 2D physics system
    Code (csharp):
    1. public void OnJellyTriggerEnter2D(JellySprite.JellyCollider2D collider)
    2. {
    3. }
    4.  
    5. public void OnJellyTriggerStay2D(JellySprite.JellyCollider2D collider)
    6. {
    7. }
    8.  
    9. public void OnJellyTriggerExit2D(JellySprite.JellyCollider2D collider)
    10. {
    11. }
     
  12. Goodev

    Goodev

    Joined:
    Feb 19, 2013
    Posts:
    22
    'Ref's are only make on runtime?
    If I want to set rigidbody2d:linear drag, I can't set with editor,
    It's supported only joint values,
     
  13. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Ah, sorry! That should be an option - I'm not sure why it isn't already. Perhaps linear drag wasn't a property of RigidBody2D when I first wrote the asset?

    Anyway, I've just submitted an update (version 1.25), which will add drag and linear drag to the inspector when running in 2D mode. It might take a day or two before it appears for download in the asset store.
     
  14. stevelie

    stevelie

    Joined:
    Feb 6, 2015
    Posts:
    15
    Hi there,

    just started using jelly sprites for the last couple days. Great work!
    By the way, i can't seem to make the object stop moving. let's say, i dropped a jelly sprite, and then on the ground it will keep wobbling forever. I tried different spring stiffness and damping combination, but nothing can seem to make it stop moving. Do you have any idea of how i should accomplish this?
     
  15. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - yeah, as with anything physics-y, it can require a bit of trial and error to get stuff behaving as you'd like it to. I'd say that spring damping is probably the main thing that you want to tweak, but mass and spring stiffness will also play a factor.The shape that you're using will also play a part in how stable the whole object is. It might be worth grabbing one of the Jelly Sprites from the demo and using that as a base - they should all be fairly stable.

    Alternatively, if you wanted to dampen the movement programatically, you could do something like this in a script attached to the Jelly Sprite gameobject:

    Code (csharp):
    1. float damping = 0.98f;
    2. JellySprite jellySprite = GetComponent<JellySprite>();
    3.  
    4. foreach(JellySprite.ReferencePoint referencePoint in jellySprite.ReferencePoints)
    5. {
    6.     if(referencePoint != jellySprite.CentralPoint)
    7.     {
    8.         if(referencePoint.Body2D)
    9.         {
    10.             referencePoint.Body2D.velocity *= damping;
    11.         }            
    12.         else if(referencePoint.Body3D)
    13.         {
    14.             referencePoint.Body3D.velocity *= damping;
    15.         }
    16.     }
    17. }
    So that just iterates over all of the physics bodies and forcibly scales their velocities down by a set amount each frame.
     
    wangzj89 and maltadirk like this.
  16. stevelie

    stevelie

    Joined:
    Feb 6, 2015
    Posts:
    15
    By the way, im using a more complex sprite shape, instead of just simple circle or square shape sprite. Does that has anything to do with the stability too?
    And i found something weird. Sometime when i hit "save" ( ctrl+s ), i lost all my body configurations. Im using "free" type. Can't do a ctrl+z to get my configurations back. Is that a bug?
     
  17. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    A complex shape could certainly introduce more instability, yeah. If you've not tried it already, the 'Attach Neighbours' toggle in the Inspector might help, as that adds extra spring joints in an effort to make the overall shape more stable.

    Yeah, if you're losing you configuration then that sounds like a bug - I've not seen that before but I'll try to reproduce it on my machine. Let me know if you spot a pattern to it happening, or see any errors in the debug output that might shed some more light on the problem.
     
  18. iviachupichu

    iviachupichu

    Joined:
    Feb 6, 2015
    Posts:
    28
    Hi! I just realized that you also made the Sprite Slicer asset. The two assets will not work correctly together without modification, correct? Sprite Slicer recalculates two 2D Polygon Colliders according to line that bisects the original collider, whereas Jelly Sprites manages its own system of (Circle) Colliders attached to a central point connected by springs. I assume you can have a 2D Collider do nothing on collision, forcing the sprite to use the jelly system. In the case where Sprite Slicer attempts to slice a Jelly Sprite I imagine the following outcome:

    The jelly system is naively copied into both new sprites, resulting in both sprites possessing jelly systems that are the same size as the original. The missing sections are simply hidden by the alpha mask and the modified 2D Polygon Colliders will still be disabled. As a result the sprite may appear split but you've effectively just created two copies of it with the missing sections invisible and physically still acting like the full jelly system.

    As a workaround you could use Sprite Slicer's ability to call methods on newly split sprites and manually adjust their jelly systems to the correct size based on their new size. This would be a little tedious but you could probably just make a "Free" system with the vertices placed on top of the vertices of the new 2D Polygon Collider calculated by Sprite Slicer, plus along midpoints for larger objects.

    I apologize for the oddly specific question. I'm new to Unity and would like to create a 2D game that has some combination of sprite destruction/modification and softbody physics. Don't really need both on the same sprites but it'd be cool. I believe the "Destructible 2D" asset fills my needs more completely than Sprite Slicer and mukow's Jello Physics is more physically accurate for softbodies (plus open-source now). With that said, Jelly Sprites seems less calculation-intensive and preferable for simpler objects like a jelly square. I would strongly consider using it along with Jello Physics, as it never hurts to have more options and I'm fairly positive they can interact with each other.

    You seem like a cool guy. I kinda want to buy your assets on that fact alone but right now I'm unemployed and, while I'm not poor, I can't buy all the tantalizing assets on my wishlist. Most of my practical experience is with Python (kivy). I've used C/Java but not C#, so just need a little nudge in the right direction while I acclimate to C#/Unity.

    tl;dr Is there a straightforward way to adjust jelly sprites during runtime so that newly instantiated sprites such as the ones created by Sprite Slicer can be properly jellified? I can most likely handle the coding once I get more familiar with Unity but right now I kinda just want an excuse to buy your asset. 'A'd
     
    Last edited: Feb 8, 2015
  19. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - good question!

    Yeah, you're correct that the two assets wouldn't be natively be compatible with each other. The first issue would be that a Jelly Sprite doesn't really have a collider of its own - everything is handled by the reference point colliders created by the Jelly Sprite system. Sprite Slicer works by raycasting against physics objects in the world and detecting points where a ray both enters and exits a collider (and then slicing along that line) - with a Jelly Sprite, it'd just intersect one of the reference points and attempt to slice that, which obviously won't produce the intended result.

    Imagining for a second that you could slice a Jelly Sprite, Sprite Slicer won't automatically add any components to the child objects beyond a collider, rigid body, and bits required for the sprite renderering, so you would definitely have to manually add a Jelly Sprite component and then programatically configure it. The initial body configuration is based on the sprite dimensions, so it should give you something vaguely sensible to work with, but you'd almost definitely want to tweak it to get the correct shape (as you say, adding bodies at the vertex positions might work okay for low vertex-density objects)

    Sprite Slicer/Destructible 2D + Jello Physics might be the best approach for this, as Jello Physics bodies do have proper polygon colliders so should (theoretically) work much better with the slicing algorithms (although I can't remember if its possible to give something Jello Physics properties at runtime). Jello Physics is pretty heavy in terms of performance though (and generates a bunch of garbage), so not ideal for mobile usage if you were planning on heading down that route.
     
  20. lordhamburger

    lordhamburger

    Joined:
    Jul 24, 2014
    Posts:
    39
    Hi there, I wanted the jelly sprite object to lerp towards my player character in my game but it doesn't seem to be moving at all, is there something special I need to do to be able to add movement to the jelly sprite object?
     
    Last edited: Feb 13, 2015
  21. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - are you just trying to modify the Jelly Sprite transform directly? That won't work - the transform is directly linked to the Jelly Sprite physics bodies, and automatically gets placed at the position of the central physics body on each frame (so even if you manually change the position, it'll just snap back to the old position on the next frame).

    Generally, when moving Jelly Sprites, you'll want to do it by adding physics forces. By doing that, you'll make them naturally bounce and wobble as they move, and generally appear more Jelly-like. So, eg.

    Code (csharp):
    1. GetComponent<JellySprite>().AddForce(movementForce);

    However, if you do need to move a Jelly Sprite to an explicit position, you can use this function:

    Code (csharp):
    1. GetComponent<JellySprite>().SetPosition(newPosition, false);
     
    theANMATOR2b likes this.
  22. lordhamburger

    lordhamburger

    Joined:
    Jul 24, 2014
    Posts:
    39
    I got the addforce working, I'll just set up the enemy encounter with this, thank you! Really cool asset by the way!
     
    Last edited: Feb 16, 2015
  23. maltadirk

    maltadirk

    Joined:
    Mar 12, 2014
    Posts:
    43
    Hey @mrsquare
    I'm having a bit of an issue with how the Jelly Player moves and jumps on a moving platform or downward hill.
    When the player jumps I use addForce(0.0f, forceValue). Would you have a recommendation on how to get the players force be natural when on a jumping on moving platforms or downhill slopes.
    Example if the player goes down a steep downhill and presses jumps he gets an unnatural movement of simply jumping upwards with zero horizontal movement. With regards moving platforms I set the Player to a child of the platform using trigger which works fine when the player doesn't jump, but when the player tries to use the horizontal momentum by jumping from a moving platform the same issue with zero horizontal movement occurs.
     
  24. lordhamburger

    lordhamburger

    Joined:
    Jul 24, 2014
    Posts:
    39
    I have a question, I set it up so that the jelly sprite can flip by toggling the m_FlipX boolean to true but for some reason it only flips the jelly sprite object when I have it selected in the editor... Any idea how to fix this?
     
  25. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - try calling SetFlipHorizontal()/SetFlipVertical(). Although you can just modify the m_FlipX/Y flags, at runtime you then need to refresh the visible mesh - those functions just simplify the process and do all that for you :)
     
    lordhamburger likes this.
  26. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Unity physics forces always work in world space - so applying force of (0, 1) always means 'up', regardless of the angle that the body is at. It sounds like you want to add the force along the normal of the surface that the Jelly Sprite is standing on - so eg. a platform tilted at 45 degrees to the right would have a normal direction (0.5, 0.5). How you actually calculate the ground's normal is a bit more complex - there seem to be a few topics on the subject if you search the forum though.
     
    maltadirk likes this.
  27. lordhamburger

    lordhamburger

    Joined:
    Jul 24, 2014
    Posts:
    39
    Awesome thanks man, calling it with GetComponent<JellySprite> ().SetFlipHorizontal(true); worked perfectly
    thanks again.
     
  28. stevelie

    stevelie

    Joined:
    Feb 6, 2015
    Posts:
    15
    Hey there,

    So ive been trying to move the jellysprite using addForce. But somehow i cant make it works. Can you tell me whats wrong with the code?

    Code (CSharp):
    1. float rand_force = Random.Range(-100f,100f);
    2.  
    3.  obj.transform.position = pos;
    4.  obj.GetComponent<JellySprite>().AddForce(new Vector2(rand_force,rand_force));
     
  29. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey,

    It might just be that the force is too small? I tried using that force value in the demo scene and the blob objects barely moved. The script that I wrote to make them bounce around uses forces in the thousands - try scaling it up by like 20 or sol.
     
  30. lordhamburger

    lordhamburger

    Joined:
    Jul 24, 2014
    Posts:
    39
    I have one more question as well. I am having a hard tiem using public void OnJellyCollisionEnter2D(JellySprite.JellyCollision2D collision)

    normally if I was going to set up a collision I would do
    if (collision.gameObject.tag == "coconut");
    but it doesn't seem to recognize gameObject when I use the if statement within OnJellyCollisionEnter2D

    I guess what I am trying to say is I want him to only shrink in size when he gets hit by an object tagged "coconut"... any thoughts on how I could do that?

    Update: I used a coroutine to shrink him and its good I just need help having it so it only happens when a tagged object hits it...
     
    Last edited: Feb 22, 2015
  31. stevelie

    stevelie

    Joined:
    Feb 6, 2015
    Posts:
    15
    i tried 10000000f force, still not moving at all.
    also when i tried to do this,
    Code (CSharp):
    1. obj.GetComponent<JellySprite>().Rotate(Random.Range(0,359f));
    i got this error
    "NullReferenceException : Object reference not set to an instance of an object
    JellySprite.Rotate (Single angleChange ) (At Assets/JellySprites/Scripts/JellySprite.cs:1338)"
     
    Last edited: Feb 21, 2015
  32. Omidja

    Omidja

    Joined:
    Jul 16, 2014
    Posts:
    18
    i opened jelly sprites in my game but in demo when i change floor,s 3dcollider to 2dCollider and 2dRigidbd,my sprites fall
     
  33. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - for a JellyCollision2D, you'd need to do:

    Code (csharp):
    1. if (collision.Collision2D.gameObject.tag == "coconut")
    The syntax is slightly different from a regular Collision2D, as the JellyCollision2D object encapsulates the Collision2D object along with info on the Jelly Sprite reference point that generated it.
     
  34. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hmm - that should work fine. I tried doing that in the demo scene just now (set all Jelly Sprites to '2D' mode, and remove the RigidBody/BoxCollider on the floor and replace with RigidBody2D and BoxCollider2D) and it worked fine. I would suggest checking that

    a) The new floor is kinematic, otherwise that'll fall down too!
    b) Check what layers the Jelly Sprite/floor gameobjects are using, and make sure that they are set to collide with one another (Project Settings->Physics 2D)
     
  35. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - just tried this out myself:

    The problem is that you're attempting to interact with the Jelly Sprite before Unity has called Start() on it. The Start function is where the Jelly Sprite sets up all the physics bodies, so if you try to apply a force before that is called then nothing will happen as it doesn't physically exist in the world. Same goes for rotation.

    Try applying the force on the next update frame - you could do this quite simply using a coroutine, eg.

    Code (csharp):
    1. {
    2.     ....
    3.     GameObject obj = (GameObject.Instantiate(my_obj)) as GameObject;
    4.     StartCoroutine("ApplyJellyForce", obj.GetComponent<JellySprite>());
    5. }
    6.  
    7.  
    8. IEnumerator ApplyJellyForce(JellySprite jellySprite)
    9. {
    10.     //Wait one frame
    11.     yield return null;
    12.  
    13.     //Apply a force
    14.     float rand_force = Random.Range(-2000f, 2000f);
    15.     jellySprite.AddForce(new Vector2(rand_force, rand_force));
    16. }
     
  36. lordhamburger

    lordhamburger

    Joined:
    Jul 24, 2014
    Posts:
    39
    Thanks Mr.Square, you are the man! Keep coming out with cool assets!
     
  37. Goodev

    Goodev

    Joined:
    Feb 19, 2013
    Posts:
    22
    Calculate collider position has bug.

    1. I set Circle body with Collider Rotation
    2. Click 'Copy Configuration To Free Mode'

    It looks fine.
    But, If it played, collider position is strange,
    I think rotation apply after free mode,

    If I set value 'm_SoftBodyRotation' to '0' on method "OnCopyToFreeModeSelected"
    Temporarily, It can be fixed.
     
  38. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Good spot - thanks! I'll submit a fix for that this weekend.
     
  39. SkyboardSoftware

    SkyboardSoftware

    Joined:
    Jul 20, 2013
    Posts:
    39
    Hey @mrsquare

    I want to say thanks for making such a great plugin. Money well spent.. but I have a issue where once the jellysprite is in a stopped position (visually) there is still micro movements taking place on the x and y... these micro movements are causing camera gitters (even with late update and late script ordering). I have tried to play around with the damping with no success. any quick solutions on making the jelly hault if no user movement has been issued.... Thanks again!!

    update:
    I think the jitter has to do with my camera tracking the jelly character... I have since played with various follow camera routines and have the jitter down to a minimum... but I think if the character would just stop moving micro amounts the jitter would seize to happen...
     
    Last edited: Mar 5, 2015
  40. SkyboardSoftware

    SkyboardSoftware

    Joined:
    Jul 20, 2013
    Posts:
    39
    Hey @mrsquare

    I have moved on from the jitter issue... but now I am working on a way of using a 2D Distance Joint as a grappling hook. I have run into a little stumbling block. I have tried to parent the main jelly to an object and use the parent as the Connected Rigid body with no success. Also setting the jelly to kinematic didn't do the trick either. Was wondering if you could point me in the right direction. Thanks alot!

    Update: I ended up setting the Central Ref Point as the Connected Rigid body and bingo! the jelly quickly responded to the distance joint. my bad.. I was pre setting up the joint before runtime... as the ref points are not initialized prior to playmode.
     
    Last edited: Mar 7, 2015
  41. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Hey - sorry, was just sitting down to look at these issues then spotted that you've fixed them!

    Regarding the jitter - perhaps you could get around this by not tracking the Jelly Sprite position directly, but instead smoothly track a Vector3 position value that only gets updated when the Jelly Sprite has moved more than a certain distance from it. So if the Jelly Sprite is sat still but vibrating slightly, the tracked position won't move and therefore the camera will remain static.
     
  42. SkyboardSoftware

    SkyboardSoftware

    Joined:
    Jul 20, 2013
    Posts:
    39
    yes. I like this concept. I think I will be able do it. One thing I have noticed is that when my character is on a slope and his velocity slows down to a stop the micro movements actually fully stop.. but when the jelly is on a flat surface micro movements occur. very interesting behavior. :)

    I have been pulling my hair out trying to get a distancejoint2d to visually be drawn. I was hoping to have a jelly looking rope to be drawn. I tried a few times at getting a jelly to stretch like a rope as the distancejoint2d with no success. I will keep at it. The jellybridge would be cool if I could turn it into a rope.

    you can see the jitter here:


    my current work on making a ropelike gameobject
     
    Last edited: Mar 13, 2015
  43. maltadirk

    maltadirk

    Joined:
    Mar 12, 2014
    Posts:
    43
    @mrsquare Is Jelly Sprites compatible with Unity 5?
     
  44. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    241
    Yep, it's 100% compatible with Unity 5.

    However, if you're switching from Unity 4 to Unity 5, then you should be aware that 5 has a lot of changes to the underlying physics systems. You'll probably need to go over all your existing Jelly Sprites and tweak the spring stiffness/damping values in order to get them to behave as the did under Unity 4.x.
     
  45. GloomDesign

    GloomDesign

    Joined:
    Jan 19, 2015
    Posts:
    2
    perfect thanks :)
     
  46. Santosh-Patil

    Santosh-Patil

    Joined:
    Apr 1, 2013
    Posts:
    6
  47. SkyboardSoftware

    SkyboardSoftware

    Joined:
    Jul 20, 2013
    Posts:
    39
    hi! @mrsquare

    I have been trying to get the sorting order to work. My issue is that during runtime the sorting layer always get reset to 30 and this is a issue.. as I have a 2D water layer that needs to draw overtop of the jellysprite. In all my attempts I have yet been able to get the jellysprite to draw behind the water.... Any suggestions.

    [​IMG]
    [​IMG]
    Thanks btw

    Update!
    I managed to add a script from
    https://github.com/nickgravelyn/UnityToolbag/tree/master/SortingLayer

    which exposes the sorting layer and overrides the int32 value of 30 that stays constant. Adding the script allowed me to make the jellysprite go behind the water!

    [​IMG]

    Whoo hoo!
     
    Last edited: Mar 15, 2015
  48. maltadirk

    maltadirk

    Joined:
    Mar 12, 2014
    Posts:
    43
    Hey @mrsquare. I'm trying to create a checkpoint system in a game. I'm using the 2D side Jelly Sprite.
    So I have an array of transforms to depect where my checkpoints are located once the played touched a kill trigger. Only problem is that if I try move the player to that checkpoint location the jelly spite goes all crazy and deforms really badly. I tried implementing the checkpoint system being used in 3DBuzz but to no avail.



    Any help would be greatly appreciated! :)
     
  49. SkyboardSoftware

    SkyboardSoftware

    Joined:
    Jul 20, 2013
    Posts:
    39
    hi @mrsquare.

    Another quick question... Lets say I change the jellysprite's spriteimage during runtime via a script and want to have the jellysprite auto correct the collider positions based on the new image what is the procedure? Perhaps do you think destroying the jelly and then spawning a fresh jellysprite for the new sprite would be best... or reusing the already established sprite and just changing the image....and using at this moment a unknown method for resetting the jelly's colliders based on the new image....


    update: I just tried to use the "ReInitMaterial" method and I think it worked as I desired. I will keep testing.
     
    Last edited: Mar 25, 2015
  50. SkyboardSoftware

    SkyboardSoftware

    Joined:
    Jul 20, 2013
    Posts:
    39
    I was thinking you could perhaps increase the spring damping to a high value and then reduce it after you have moved the character? just a thought while I work on my issue.