Drag that script onto a Game Object in your scene (like a Cube). A script won't run unless it's a "Component" on an object. C# Scripting in Unity
Every standard Unity script (inheriting from MonoBehaviour ) comes with two essential "hooks": How We Optimised Our Scripts in Unity | by Ondřej Kofroň
"We use cookies to give you more relevant browsing experience and improve our website.
Using this site means that you are agree with our use of cookies."