How do I make something fall when player is nearby ?

I’m trying to make a enemy fall when player is nearby. Have you played Mario series? There’s a enemy that falls to smash you and make you lose a life. I want to do something like this.

If your talking about a thwomp, then there are 3 different ways to make it.

  1. Use a raycast shooting down
  2. Filter the players x value
  3. Use another object as a trigger

Thank for the help
o/