Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Simulating a sand surface?

Discussion in 'Physics' started by Nanako, Feb 11, 2016.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    I'm trying to make a scene where the ground is sand, it's a building site.

    The idea is to have lots of heavy objects sliding, falling, breaking, and generally being thrown around. I'd like the sand to be able to catch them. Generally anything falling into it should dig in and come to a stop quickly, things shouldn't roll or slide on it.

    I've tried messing around with the physic material settings, but even setting friction to maximum, and bouncing to minimum, doesn't seem to work. Objects sliding across it in full contact are stopped fairly quickly, that's good at least.
    Objects moving at high speeds still bounce off it, and anything that's rolling or tumbling just continues to do so, while making minimal contact with the ground

    I could do with some advice on how to get this working.

    More complex details, like adjusting the heightmap to mould around things are a secondary concern. right now i just need to get objects to stop somewhat realistically on impacting it
     
  2. alexisrabadan

    alexisrabadan

    Joined:
    Aug 26, 2014
    Posts:
    82
    Smooth collisions by using a raycast in a downwards direction and applying force in the opposite direction when the raycast detects something (I just asked a question on this thread about my raycast spring system that uses a similar method to what you would want). Most studios I believe would design a special shader for the sand as well, as adjusting the height map constantly will impact performance.