How can I kill my character if he stops running or moving

I’m making an endless game and I want my character to be killed if he stop running or moving.

I think for real game, here should be some better logic, but as answer, try this:

https://i.imgur.com/euz6MxV.png

Do you really need it to be killed/destroyed?

Maybe it is better to simply play some “death” animation, show some “Game Over” UI and restart level?

If you want to destroy it, you will need to respawn it again and maybe get some errors if something referencing it.

You are generally right, but he asking how to kill on zero speed not how to deal with killed characters…