Sometimes script just stops working (any script).To work again I have to disable the script and enable again.
Another solution is to create a new script and just copy the content.
Unity: 2019.3.0f1
Windows 10 64bit
Neat! If you can make a fresh blank project and replicate this problem, please file a bug with Unity.
If you can’t replicate the problem with a blank project, make a backup copy of your project and try it in the duplicate.
If it still doesn’t work, steadily destroy scripts in your duplicate project until it works.
Or if you are using source control (you should be!), you can delete stuff trivially and then restore it.
I will try to replicate problem in a blank project but this problem doesn’t always happen.