Is there a "fluffy" or "squishy" 2D collider?

Hi, I’m trying to simulate a boat in water in 2D. I want the boat to react to waves. I have colliders on the boat and on my water line, but its very ridged. I want the boat to go up when a wave comes, but not exactly in line with the wave.

Is there a way to make the wave colliders softer? so the boat will press into them and move up but not exactly at the same rate as the wave.

Also, is it possible to have mass affect the reaction. So a paper boat would basically ride the wave as is, but the Queen Mary wouldn’t realy move at all?

Thanks!!

Buoyancy works by applying an upwards force that is proportional to the volume of liquid displaced by an object. In (very heavy) pseudo code that might work like this

if(collider.lowerbound < water.uperbound){
    float percentSubmerged = (collider.boundsHight)/(water.uperbound - collider.lowerbound);
    rigidbody.AddForce(Vector3.Up * percentSubmerged * volume);
}

Using this will allow the physics engine to account for the mass of the object and the impacting velocity. It won’t do surface tension effects.

You could make them into trigger colliders, and have them apply an upward force at the point of contact in their OnTriggerEnter2D and OnTriggerStay2D events. (Be aware that lots of “OnTriggerStay2D” events can really bog a game’s performance down.)