Search Unity

Jelly Mesh - Soft body style physics for 3D meshes

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

  1. babji3

    babji3

    Joined:
    May 28, 2015
    Posts:
    179
    can u help me
     
  2. babji3

    babji3

    Joined:
    May 28, 2015
    Posts:
    179
    sorry . i understatnd this, the object takes again zero frame at the end ,so the object turns again. my mistake .

    i want anothr help.
    How to rotate jelly mesh at runtime ? am using c#.
    thx..
     
  3. babji3

    babji3

    Joined:
    May 28, 2015
    Posts:
    179
    can u plz tell me how i rotate jelly mesh at runtime??
     
  4. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey,

    Try using the 'AddTorque' functions to apply a rotation force to the central body - eg.

    Code (csharp):
    1. GetComponent<JellyMesh>().CentralPoint.Body3D.AddRelativeTorque(Vector3.left * force);
    (obviously you'll need to alter the force depending on what direction/force magnitude you want). Also, make sure you don't have any of the 'Freeze Rotation x/y/z' flags set on the Jelly Mesh in the inspector :)
     
  5. babji3

    babji3

    Joined:
    May 28, 2015
    Posts:
    179
    Thanks for your replay.
    You mean i have to rotate central body and no need to rotate jelly mesh?

    Can u tell me how do i scale?
    I read that i have to write separate function for that..
    thx..
     
  6. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Yeah - the other physics bodies are all attached to the central body, so if you rotate that then the whole Jelly Mesh should rotate and still keep its jelly-like properties.

    If you want to scale the Jelly Mesh, you need to use:

    GetComponent<JellyMesh>().Scale(x)

    where 'x' is a ratio. So 2 = double the size, 0.5 = half the size, etc.
     
  7. babji3

    babji3

    Joined:
    May 28, 2015
    Posts:
    179
    Thank you very much..
     
  8. hungseparate

    hungseparate

    Joined:
    Aug 25, 2014
    Posts:
    10
    Hi, how can it work with Dotween ?
    I want to run action, that scale from 1 to 0.25 for example, how can i do that ?
     
  9. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - I'm not familiar with Dotween specifically, but you can use eg.:

    Code (csharp):
    1. GetComponent<JellyMesh>().Scale(scaleRatio)
    to scale the Jelly Mesh size, so you'd just need to call that from the Dotween action.

    It's worth noting that the scale value that you pass into that function is relative the current Jelly Mesh size - so 0.5 is half the current size, 0.25 is half the current size, etc. If you want to scale the Jelly Mesh to an explicit size, you'd need to work out the scale relative to the current size (eg. the mesh is currently size 2, I want it to be size 0.9, therefore the scale ratio is 0.9/2 = 0.45).
     
    hungseparate likes this.
  10. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
  11. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - I think you'd struggle to get is as precise as that video to be honest. It looks as though that asset is using a non-physics based solution - you can tell as the cubes only wobble in one direction (if you're rolling up then they wobble along the Z axis, if you're rolling right then they wobble along the X axis). If you were doing it with a Jelly Mesh then you'd probably be best off controlling the position and rotation of the cube yourself (to get the snappy movement), and then just applying some forces manually to make it wobble.

    But yeah, being entirely physics based, Jelly Mesh isn't great for situations where you need very precise positioning or angles. The approach they've gone for (I assume they're just animating the mesh vertices) is much better for a puzzle-game type scenario as it looks really natural but is actually quite rigidly defined, which is essential to keep the cubes and the board tiles lined up at all times.
     
  12. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Thanks for the answer, and the honesty :)
     
  13. SquareEyesTaco

    SquareEyesTaco

    Joined:
    Mar 25, 2013
    Posts:
    28
    Hi i bought this asset and im just trying to roll my sphere around with the jelly mesh acting like a blob, the code
    GetComponent<JellyMesh>().CentralPoint.Body3D.AddRelativeTorque(Vector3.left*force); Comes back with some invalid arguments can you help?
     
  14. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - that seems to work for me. What version of Unity are you on? And when you say 'invalid arguments', is that a compile error you're seeing (ie. the game won't even start)? Or does the game start and you see that error in the output?

    Here's the full script - just add this to your Jelly Mesh object and then tweak the force value in the inspector:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class BlobRollScript : MonoBehaviour
    5. {
    6.     public float force;
    7.  
    8.     void Update ()
    9.     {
    10.        GetComponent<JellyMesh>().CentralPoint.Body3D.AddRelativeTorque(Vector3.left*force);
    11.     }
    12. }
    (tested in Unity 5.2)
     
  15. SquareEyesTaco

    SquareEyesTaco

    Joined:
    Mar 25, 2013
    Posts:
    28
    Thank you so much for taking the time to help me :)

    If you can imagine i am making a game about a fat guy that you have to roll into a gym down a narrowing path similar to monkey ball.
    Initially i was trying to use your blob mesh thing to work with the roll the ball tutorial on the unity help forums. of course rigid body made it go crazy. So i figured it i could just place the blob as a child to another object that was the roll the ball then it would work but the rigid body made it go crazy.

    So your code made it rotate but i still cant get it to work with the roll the ball movement. is this even possible?
     
  16. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey,

    I think the best approach would be to just remove the ball rigid body from the tutorial and replace it with a Jelly Mesh object, rather than trying to parent the Jelly Mesh to the ball object. Like you saw, parenting a Jelly Mesh to something else can causes the physics to go a bit crazy as you get the two different systems conflicting with one another - you really need to attach it with joints if you want everything to behave.

    Try using something like this on the Jelly Mesh object and it should move + roll around (this is adapted from the PlayerController script in the roll a ball tutorial):

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. [RequireComponent(typeof JellyMesh))]
    5. public class PlayerController : MonoBehaviour
    6. {
    7.     public float speed = 50.0f;
    8.     public float torque = 10.0f;
    9.  
    10.     private JellyMesh jellyMesh;
    11.  
    12.     void Start()
    13.     {
    14.         jellyMesh = GetComponent<JellyMesh>();
    15.     }
    16.  
    17.     void FixedUpdate ()
    18.     {
    19.         float moveHorizontal = Input.GetAxis ("Horizontal");
    20.         float moveVertical = Input.GetAxis ("Vertical");
    21.  
    22.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    23.  
    24.         jellyMesh.AddForce(movement * speed, true);
    25.         jellyMesh.AddTorque(movement * torque, true);
    26.     }
    27. }
     
  17. SquareEyesTaco

    SquareEyesTaco

    Joined:
    Mar 25, 2013
    Posts:
    28
    words cant express the joy and hapiness surging through my body at this point!! thank you so much!!!!
    wish you had a tip jar!!! thanks man!!! ill be sure to leave a 5 star review!!
     
  18. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    When trying to Instantiate Jellymesh prefabs via code, they render in simply with a pink material. What is the issue here?



    Code (CSharp):
    1. [SerializeField] private GameObject cakePrefab;
    2.  
    3. GameObject go = GameObject.Instantiate(cakePrefab, pos, cakePrefab.transform.rotation) as GameObject;
     
  19. NathanHale1776

    NathanHale1776

    Joined:
    Mar 22, 2014
    Posts:
    46
    @mrsquare : what would be the method to make one of the jellies goto a target? I'm trying to make sort of a "simulated life" using your asset, but am having problems figuring out your system to have it go to a target object. thank you.
     
  20. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - sorry, not sure why I didn't get a notification for this post. Pink suggests an invalid material - either the shader/texture/material is missing. If you're still having issues, hit me up on PM and I can try to help you out :)
     
  21. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - have replied via email, but for anyone else wondering a similar thing:

    Always make sure you're interacting with the actual Jelly Mesh physics bodies when you try to apply forces. Accessing a local RigidBody component won't work on the Jelly Mesh gameobject as the physics bodies are separate from the actual mesh object. You need to do something like:

    The easiest approach it to just use the JellyMesh AddForce functions, swapping them out for the standard Unity ones. So instead of:

    Code (csharp):
    1. GetComponent<Rigidbody>().AddForce(someForce);
    do this:

    Code (csharp):
    1. GetComponent<JellyMesh>().AddForce(someForce, true);
     
  22. SquareEyesTaco

    SquareEyesTaco

    Joined:
    Mar 25, 2013
    Posts:
    28
    ive been trying for a few months now to make it so another object is attached to part of the blob as it rolls around but ive never been able to make it work. basically the body parts keep floating at a certain point relative to the blob...almost like its orbiting. i just want them to attach to the blob and stay at that point on the blob as it rolls.

    sorry im not sure if i made much sence :/
     
  23. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - how are you attaching the child object? If you just make the child object a child of the Jelly Mesh gameobject then I can see this happening.

    You probably need to use the attach point system instead. You basically create two separate objects, position them in the scene, and then use the attach point system (in the Jelly Mesh component's inspector) to connect them. Check out the two conjoined orange blobs in the demo scene as an example.
     
  24. SquareEyesTaco

    SquareEyesTaco

    Joined:
    Mar 25, 2013
    Posts:
    28
    omg..been literally trying to get this to work for like 6 months lol thank you so much
     
  25. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    Hi mrsquare, first thing, well done for an amazing asset! Loving playing around with JellyMesh and seeing what it can do.. got a quite solid game idea already in the works. Just wondering how much it would take for you to create PlayMaker actions for things like AddForce, AddTorque, etc, I like using PlayMaker for rapid prototyping and testing and would be handy to have those actions at hand!

    For instance, here's the normal AddForce PlayMaker action, doesn't seem too difficult (I'm sure for someone like you!): http://pastebin.com/9mhtzwXg

    Thanks,
    PJ
     
    Last edited: Mar 10, 2016
    Bhanshee00 likes this.
  26. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - thanks! Glad you're finding it useful :)

    I don't actually own a copy of PlayMaker myself but I've had a few people send me copies of their Playmaker scripts in the past. This one was written for my JellySprites plugin, but the interfaces are pretty much identical (you should just be able to do a find + replace for JellySprite->JellyMesh):

    https://drive.google.com/open?id=0B1KgEHu78fKHeEJFcU44b1ZMZGc

    that one adds an 'AddForce' action, I believe, so would be easy to modify if you wanted to do eg. AddTorque instead.

    There is also a 'bridge' for the collision callbacks. shared up here:

    http://hutonggames.com/playmakerforum/index.php?topic=12335.0

    (again, for JellySprites, but should be compatible with Jelly Mesh, with a few tweaks).
     
  27. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    Great, thanks! Will have look at them and post back amended for JellyMesh if I get them working.
     
  28. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    Hi again mrsquare, I'm having an issue with the jelly mesh where the player has the jelly mesh and has a Reflection Probe as a child. The player has very reflective material and the issue is that it's picking up and reflecting every now and then what's under the floor too. I have a platform and a very bright source under the platform and the jelly player flicks reflection from the bright source every now and then. I assume it's to do with the fact that part of the jelly player actually sits inside the floor.

    Any good ideas on how to stop it from reflecting what's under the floor? I don't want to exclude the objects under floor as they need to be reflected as the player leaves the platform..

    Thanks,
    PJ
     
  29. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    Also, I'm having some issues with camera follow scripts. If the player has the JellyMesh script attached, the camera movement is jerky, trying to follow the 'wobble', I assume. I'm using an Orthographic camera view. Do you have a good solution/script to this problem, I've been trying to scour the net for an answer without finding one..

    The script I'm currently using is this:

    Code (JavaScript):
    1.  
    2. var target : Transform;
    3. var distance = 10.0;
    4. var damping = 6.0;
    5.  
    6. var xMaxPosition = 0.6;
    7. var xMinPosition = 0.4;
    8.  
    9. var yMaxPosition = 0.6;
    10. var yMinPosition = 0.4;
    11.  
    12. function LateUpdate ()
    13. {
    14.     transform.position.z = distance;
    15.       var pos = GetComponent.<Camera>().WorldToViewportPoint (target.position);
    16.       if (pos.x > xMaxPosition)
    17.           transform.Translate (damping * Time.deltaTime, 0, 0);
    18.       if (pos.x < xMinPosition)
    19.           transform.Translate (-damping * Time.deltaTime, 0, 0);
    20.       if (pos.y > yMaxPosition)
    21.           transform.Translate (0, damping * Time.deltaTime, 0, 0);
    22.       if (pos.y < yMinPosition)
    23.           transform.Translate (0, -damping * Time.deltaTime, 0, 0);
    24. }
     
  30. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    You could maybe separate the reflections probe out to a separate gameobject, and then use the 'attach point' system to attach it to the Jelly Mesh? See how the eyes are attached to the blobs in the demo scene if you need an example.

    That way, you could position the probe object slightly higher than the Jelly Mesh itself, and it should prevent it from clipping through the floor even when the Jelly Mesh tranform does.
     
  31. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    I generally prefer to use a filtering value for stuff like this - eg.

    Code (csharp):
    1.     void LateUpdate ()
    2.     {
    3.         var desiredPosition = target.position;
    4.         desiredPosition.z = distance;
    5.  
    6.         var currentPosition = transform.position;
    7.         var smoothedPosition = (currentPosition * (1.0f - filterFactor)) + (desiredPosition * filterFactor);
    8.  
    9.         transform.position = smoothedPosition;
    10.     }
    'filterfactor' should be a value between 0 and 1 - the lower the value, the smoother the movement. So if you set it to 0.1, the camera will move 10% of the distance between its current position and the 'correct' position each frame. 0.01 would mean 1% of the distance, etc.

    The advantage of this approach is that it copes equally well with big changes in movement as well as small ones. If the target object suddenly moves miles away, the camera position will rapidly compensate, but then smoothly slow down as it reaches the correct position. Equally, small jittery movement is smoothed out nicely as you're only moving a fraction of the amount required each frame.

    You could potentially combine this with an approach that only updates the target position if it is a certain distance away from the camera (which should prevent the camera from moving at all if the target is essentially stationary, but just jiggling around a little bit).
     
  32. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    mrsquare, thanks for the quality help on both issues, will try and implement tomorrow!
     
  33. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    Thanks again mrsquare, I got the the script working with a bit of tweaking, not sure if I'm doing something I should but this works well:

    Code (JavaScript):
    1.  
    2. var target : Transform;
    3. var cameraOffset = Vector3(10,14,10);
    4. var filterFactor = 0.05;
    5.  
    6. var desiredPosition;
    7. var currentPosition;
    8. var smoothedPosition;
    9.  
    10. function LateUpdate ()
    11.     {    
    12.         desiredPosition = target.position + cameraOffset;
    13.  
    14.         currentPosition = transform.position;
    15.         smoothedPosition = (currentPosition * (1.0f - filterFactor)) + (desiredPosition * filterFactor);
    16.  
    17.         transform.position = smoothedPosition;
    18.     }
    19.  
     
  34. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Cool - yeah, that looks good to me :) This is the key bit to remember:
    Code (csharp):
    1. result = (current * filter) + (desired * (1.0 - filter))
    So just work out your desired value and then apply that little equation to produce the smoothed version of it. It's a really handy technique for smoothly interpolating between positions, values, colors, whatever, with a minimum of code required.
     
  35. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    Great, will definitely keep in mind!

    I have another issue with the Jelly Mesh to do with collision.. If a jelly is dropped from a high point and hits the floor with significant force, if the floor has a mesh collider and there is a mesh joint, one of the jelly colliders gets stuck inside the floor and can't be 'unstuck'. I've read the 'Stability' section in the manual and tried various settings for the collider, spring stiffness etc but having no luck.. Any idea how to get around this apart from having one solid collider as floor?
     
  36. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hmm - that sounds like more of a Unity physics issue than something inherent to the Jelly Mesh code. Have you tried fiddling with the values in Edit->Project Settings->Physics? Increasing the solver iteration count might do the trick (it basically increases the accuracy of the physics by running the simulation more frequently, so objects should be less likely to pass through one another).Alternatively, try altering the gravity and/or increase the rigid body drag, so that the Jelly Mesh bodies can't fall so fast.
     
  37. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Hey there, this looks fun :)

    I noticed someone posted earlier about using this with skinned mesh. Is it possible for certain parts to be controlled by jelly mesh, while the other handled by bone? Or just apply this to certain vertex group, something akin to setting up the cloth renderer.

    Cheers
     
  38. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    Hi - I've been looking at using this for making a rope - it has some advantage (like stability!) over using the usual chained rigidbodies. But one thing I can't do is stop the 'skin' moving at the ends. I have set the ends to kinnematic and they are not moving. Any thoughts?
     
  39. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - not currently, I'm afraid. I have to admit that I'm not really familiar with skinned meshes. but I seem to remember that I did try to integrate the two systems a while back and just found that the Jelly Mesh vertex changes would be immediately overwritten by whatever the skinned mesh was doing. I'll have another dig around on the forums and see if I can find any more info on how to achieve something like what you describe.
     
  40. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Have you tried increasing the 'Control Point Influence' value? This should reduce the influence of distant physics bodies on any given vertex (so the nearby physics bodies will have more influence over its position). It'll probably make it visually slightly less smooth, but the overall shape should conform more accurately to the layout of the physics bodies.
     
  41. MikeOder

    MikeOder

    Joined:
    Apr 8, 2016
    Posts:
    8
    Is it possible to unjelly an object? I am trying to implement the behavior that when you pick up a jellied object, it reshape back to its original shape. Depending on where you release it it would either need to stay that way or go back to being jelly.

    I've thought of just swapping an unjellied object for the jellied one, but that wasn't ideal. I can disable Jelly Mesh, but that just freezes the object in the distorted shape.

    Any suggestions?
    BTW - I love this asset.
     
  42. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - yeah, this should be pretty easy. If you take a look in JellyMesh.cs, UpdateMesh() function, line 1631:

    Code (csharp):
    1. m_Vertices[vertexIndex] = m_InitialVertexPositions[vertexIndex] + totalOffset;
    That is the line of code that maps the physics body movement to each vertex of the mesh. You could simply change that to:

    Code (csharp):
    1. m_Vertices[vertexIndex] = m_InitialVertexPositions[vertexIndex] + (totalOffset * m_JellyEffectStrength);
    with m_JellyEffectStrength just being a public float defined in the Jelly Mesh component. So you can just set that to a value between 0 (disabled) and 1 (normal) to scale the deformation effect up and down.

    You'll also need to disable this bit of code in the same function:

    Code (csharp):
    1. if(!haveAnyPointsMoved)
    2. {
    3.     return;
    4. }
    (or else remember the previous m_JellyEffectStrength value and allow changes to that to influence the haveAnyPoints moved calculation).
     
  43. ShinjiMan

    ShinjiMan

    Joined:
    Oct 15, 2014
    Posts:
    3
    This is very nice asset!
    It doesn't move in ios. Is there a way to move it?
     
  44. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hi - thanks! :)

    How do you mean - as in, the jelly effect isn't working? There isn't any iOS specific code in the asset, its likely to be a more general issue with your scene. Are you seeing any error messages in the output window in Xcode?
     
  45. ShinjiMan

    ShinjiMan

    Joined:
    Oct 15, 2014
    Posts:
    3
    Thank you very much for your answer.
    please help me.


    Xcode version 7.2
    Unity version 5.3.1f1 personal
    Target SDK simulator SDK


    xcode error message ↓


    2016-04-16 08:52:12.709 ProductName[9997:287527] -> registered mono modules 0x10600c400


    2016-04-16 08:52:12.918 ProductName[9997:287527] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.

    -> applicationDidFinishLaunching()

    PlayerConnection initialized from /Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data (debug = 0)

    PlayerConnection initialized network socket : 0.0.0.0 55000

    Multi-casting "[IP] 192.168.11.27 [Port] 55000 [Flags] 2 [Guid] 2969526735 [EditorId] 4294967295 [Version] 1048832 [Id] iPhonePlayer(shinji.local):56000 [Debug] 0" to [225.0.0.222:54997]...

    -> applicationDidBecomeActive()

    Renderer: Apple Software Renderer

    Vendor: Apple Inc.

    Version: OpenGL ES 2.0 APPLE-12.0.40

    GLES: 2

    GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_r

    ead_format GL_IMG_texture_compression_pvrtc

    OPENGL LOG: Creating OpenGL ES 2.0 graphics device

    Initialize engine version: 5.3.1f1 (cc9cbbcc37b4)

    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 223)


    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 223)


    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 223)


    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 223)


    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 223)


    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 217)


    The file '/Users/sun_zoo1985/Library/Developer/CoreSimulator/Devices/6D22995E-BB6A-44BA-8151-7765E40377A9/data/Containers/Bundle/Application/F8780396-A16E-4DE6-BE5C-A8CD2904BAD5/ProductName.app/Data/level0' is corrupted! Remove it and launch unity again!

    [Position out of bounds!]


    (Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 223)


    UnloadTime: 1.419264 ms

    UnityException: GameObject has undefined tag!

    at JellyMesh.AddReferencePoint (Vector3 position, Single radius, Boolean addCollider) [0x00000] in <filename unknown>:0

    at JellyMesh.CreateRigidBodiesCircle (Bounds meshBounds) [0x00000] in <filename unknown>:0

    at JellyMesh.Awake () [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)


    (Filename: currently not available on il2cpp Line: -1)


    ArgumentException: The thing you want to instantiate is null.

    at UnityEngine.AssetBundle.LoadAsset_Internal (System.String name, System.Type type) [0x00000] in <filename unknown>:0

    at UnityEngine.Object.Instantiate (UnityEngine.Object original) [0x00000] in <filename unknown>:0

    at UnityEngine.Object.Instantiate[T] (.T original) [0x00000] in <filename unknown>:0

    at FireObject.Update () [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)


    (Filename: currently not available on il2cpp Line: -1)


    ArgumentException: The thing you want to instantiate is null.

    at UnityEngine.AssetBundle.LoadAsset_Internal (System.String name, System.Type type) [0x00000] in <filename unknown>:0

    at UnityEngine.Object.Instantiate (UnityEngine.Object original) [0x00000] in <filename unknown>:0

    at UnityEngine.Object.Instantiate[T] (.T original) [0x00000] in <filename unknown>:0

    at FireObject.Update () [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)


    (Filename: currently not available on il2cpp Line: -1)


    ArgumentException: The thing you want to instantiate is null.

    at UnityEngine.AssetBundle.LoadAsset_Internal (System.String name, System.Type type) [0x00000] in <filename unknown>:0

    at UnityEngine.Object.Instantiate (UnityEngine.Object original) [0x00000] in <filename unknown>:0

    at UnityEngine.Object.Instantiate[T] (.T original) [0x00000] in <filename unknown>:0

    at FireObject.Update () [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    at System.Collections.Generic.ICollection`1[T].CopyTo (.T[] array, Int32 arrayIndex) [0x00000] in <filename unknown>:0

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)

    System.Collections.Generic.ICollection`1:CopyTo(T[], Int32)


    (Filename: currently not available on il2cpp Line: -1)
     
  46. mrsquare

    mrsquare

    Joined:
    Oct 25, 2013
    Posts:
    281
    Hey - this'll be the problem:

    Check the 'Tag' field on the Jelly Mesh object (right at the top of the inspector window, just below the name). I expect that the field is blank right now? Try setting it to either a valid tag value, or 'Untagged'.


    You also appear to have an invalid object attached to the 'Object' field on the 'Fire Object' component attached on the main camera:

    Not a major issue but it is throwing exceptions whenever you click the mouse, which will probably cause frame drops. especially if you're running on iOS. Probably easiest to just remove that component if you're not using it.


    As a general tip - always a good idea to monitor the Console window in the editor and make sure you fix any errors before deploying, as its much harder to diagnose them once Unity is running on a device. I'd be surprised if these errors weren't showing up there too. Anything with a big red exclamation mark really needs fixing, as it'll be preventing a component from functioning properly. Just double click on the error and it'll take you directly to the line of code that caused it.
     
  47. ShinjiMan

    ShinjiMan

    Joined:
    Oct 15, 2014
    Posts:
    3
    Thank you very much! It moved!
    Also please take care from now on!
     
    mrsquare likes this.
  48. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Hi, I am using your nice asset in some games, I like it very much :)
    I would like to ask a question if ok,

    On the main JellyMesh script there are options to Freeze RotationZ/X/Z ,
    Capture.PNG
    How can I access those via another C# script on the same object?
    E.g. from (using blueblob sample) JellyMeshBlobBehaviour I tried:
    m_JellyMesh.m_FreeModeBodyRadii.Clear = true;
    But I am not sure how you expose those properties, how can I control those properties programatically?
    Could you help or guide me?
     
  49. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Ah, no worries, I think I found what I wanted:
    m_JellyMesh.m_LockRotationZ = false/true :)
     
    mrsquare likes this.
  50. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Hope it is ok to ask for some additional input on a exception I'm seeing, I think it might be related to Jelly mesh, not sure yet. In the Editor I can use the Jelly Meshes perfectly, not warnings or errors show at all, I publish to Windows .exe and try to run the generated game but now the Jelly mesh won't work. In the player log I noticed the following exception:

    <snip>
    desktop: 1920x1080 60Hz; virtual: 1920x1080 at 0,0
    <RI> Initializing input.

    <RI> Input initialized.

    <RI> Initialized touch support.

    UnloadTime: 1.078787 ms
    UnityException: GameObject has undefined tag!
    at (wrapper managed-to-native) UnityEngine.GameObject:get_tag ()
    at JellyMesh.AddReferencePoint (Vector3 position, Single radius, Boolean addCollider) [0x00000] in <filename unknown>:0
    at JellyMesh.CreateRigidBodiesCube (Bounds meshBounds) [0x00000] in <filename unknown>:0
    at JellyMesh.Awake () [0x00000] in <filename unknown>:0

    (Filename: Line: -1)
    <snip>

    But why do I only see this at runtime? very weird to me, I do not understand it.
    Can I ask anyone has come across this before, or have you tried to build a game with jelly mesh and it works?
    I'm using Unity 5.4.0b19 (64-bit).