Search Unity

Object slightly sink into the material

Discussion in 'Physics' started by Kolovrat, Dec 7, 2014.

  1. Kolovrat

    Kolovrat

    Joined:
    May 5, 2014
    Posts:
    17
    Hi guys,
    I'm pretty stuck with some task and I need some advice.
    I'm trying to create Cube(or Plane) which will have a little bit complicated behavior. When the ball(or balls) fall down on that surface they'll stay a little bit on the surface and then slightly sink into the material and making hole in that material.
    My goal is to acomplish something like in this video:

    Tried couple of solutions, and the closest one I found but the ball bounces a little bit(although I've set bounce material with 0 bounciness) and it's making huge hole in the material. In the attachemt there is HTML file that shows current state. In this solution I've used Meshinator:
    https://www.assetstore.unity3d.com/en/#!/content/8228
    I'm desperate for some advice because I've lost couple of days without any progress.
     

    Attached Files:

    Last edited: Dec 7, 2014
  2. Kolovrat

    Kolovrat

    Joined:
    May 5, 2014
    Posts:
    17
    I think that I'm close to some solution, but I still need a little help.
    Now I've started working with Interactive cloth with Cube mesh.
    Curently the problem is that ball passes through the Cloth. I've tried to increase Thickness, Collision response, Friction... but without sucess. How to stop ball from passing through Cloth?

    Solution that I've found:
    http://answers.unity3d.com/questions/633921/ball-is-passing-through-interactive-cloth.html
    isn't helpfull since I receive error(in runtime): Mesh.vertices is too small. The supplied vertex array has less vertices than are referenced by the triangles array.
     
  3. Kolovrat

    Kolovrat

    Joined:
    May 5, 2014
    Posts:
    17
  4. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    If the imprints need to stay on the object or material after the ball has moved away: have you looked into heightmap meshes? On Windows (DirectX11) maybe even tesselated meshes?
    If it only has to "look" good but not actually deform the mesh - you also might get away with a parallax map.

    Batman: Arkham Origins uses this technique for the footprints in deeper snow and it looks pretty cool. Sega Rally also used a similar trick, IIRC.
    Someone on these forums made an actual Unity prototype where a driving car made imprints into the mud which stayed there, even. Unfortunately I can't remember the thread title or who it was. But it sounds like it is possible and personally I'd look into a shader based solution, first. :)
     
    Kolovrat likes this.
  5. Kolovrat

    Kolovrat

    Joined:
    May 5, 2014
    Posts:
    17
    Thanks for suggestion, I'll try to find this that you wrote. If I find some solution I'll post it here