The Start(), Update(), and Awake() methods are called automatically. The Start() method is called on the frame when the script is enabled. For most of our components, this will be when you press the Start button in Unity.
The Awake() method is called just before the Start() method. That gives a very convenient place to set up code if you have any. The Update() method is very specific. It's called on every frame if the component is enabled. It's very useful for observing user keyboard actions, for example. As you can see in our script, in Line 16Â we are checking on every frame to find out whether the user has pressed the Enter key.
Let's create a new C# script and call it LearningMethods. As you can see, the Start() and Update() methods are added automatically when you create a new script. To...