Is there a way to make a button you can step on to activate it in a platformer?

I am trying to make a button to press on when the character steps on it to activate a door. Is there any way to do this?

Here’s some sample code for ya! There are comments inside explaining it, but let me know if you need any more help!

Thank you!