I am very new to both C# and Unity, so I have been following some tutorials to create a Wall Torch (GameObject) that has a child 2D Spot Light which flickers using the following script I found on Github. https://gist.github.com/sinbad/4a9ded6b00cf6063c36a4837b15df969 According to Visual Studio, the script has no errors.
However, upon hitting Play to start the script, nothing happens. There are no errors or messages in the Console.

I have attached the script as a component to the 2D light, and made sure the class and script name are identical.
I have tried restarting the project and creating a new one, as well as deleting and recreating the script. The Unity project is 2D with URP.
I really appreciate any help.
I haven´t tested this, but I think the problem is that the script tries to get a
Lightcomponent from your GameObject, but you have aLight2Dcomponent. Try replacing thepublic new Light light;line in the script withpublic Light2D light;, and on line 45 changeLighttoLight2D, and it should work;