How to script quicksand?

I know how to add quicksand - just add a plane with a sand material, but how would I script it so that the quicksand would sink the player or any other objects slowly depending on mass and destroy the objects except for any objects with the “player” property? The players health is set to zero when it goes under.

This is similar to Super Mario 64, except the sand would require a “quicksand” property in order for the script to activate, else it would print out a message to the console and return the result.

I’d suggest setting the quicksand plane’s collision to, “ghost,” only. Then implement it so when a player collides with it → Decreases player’s gravity + mass. This will make the player slowly fall rather then quickly.

Alternatively you could also replace gravity decreasing on collision with a downwards force, as suggested here.