How enable gravity once a player has walked over it?

[Note: Its 2D]

So I want to make an object fall once the player has walked over it.

If anyone could provide a code for me, that would be great.

Attach a rigid body to the object and a collider above the object. When the player enters the collider, enable kinematic on the game objects rigidbody?