Search Unity

Advice for a soft object collision

Discussion in 'Physics' started by petey, Oct 17, 2019.

  1. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hi all!

    In a part of my game, a character jumps onto a couch (and a few other surfaces) that I’d like to be a little softer and springier. I’m not too sure how to approach softer types collisions just wondering if anyone has any pointers? My character controller is basically rigid body with colliders, and it works fine for everything else but this.

    Thanks!
    Pete
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Instead of thinking some full simulation for soft bodies, maybe you could just fake something for this specific case, similar to how jiggle bones are usually made?

    Add a bone or a few that are skinned to the area that is going to be pressed down (or however it will deform) and then use some code logic,like detect collision and start moving the bones down over time. Or build some rig with Physics system. I've not tried out to do a couch/bed etc. but I'd imagine it might be possible with springs/joints too.
     
    petey likes this.
  3. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Yeah that sounds good thanks @Olmi. I wonder if I could make a spring system that could hold up a rigid body box. Almost like a springy mattress or something :) so when you hit that you’d get boosted up. I have made something like that before but it was never intended to react to the character. I’ll give it a try and see how I go.
     
  4. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Cool this might do it :)
    Oct-18-2019 08-56-09.gif
    I'm using a spring component on a second hidden box.
    Thanks for the help!
     
    Erfan_SheikhHoseini and Olmi like this.