Unity recommends downloading Microsoft Visual Studio for editing C# scripts: "VisualStudio C# 2010 is a product from Microsoft. It comes in an Express and a Professional edition. The Express edition is free, and you can download it from here.
Unity’s VisualStudio integration allows you to create and maintain VisualStudio project files automatically. Also, VisualStudio will open when you double click on a script or on an error message in the Unity console."

Recommended Tutorials: 
Codecademy's Basics of Programming I: codecademy.com/learn/learn-how-to-code/modules/bop-i
Unity Learn Tutorials Page (check the "Scripting" topic to filter tutorials): https://learn.unity.com/tutorials
Brackeys' How to Make a Video Game in Unity - PROGRAMMING: https://www.youtube.com/watch?v=9ZEu_I-ido4&list=PLPV2KyIb3jR5QFsefuO2RlAgWEz6EvVi6&index=3
C# Programming Series - Your First Day - Unity: https://www.youtube.com/watch?v=tzq-DJeNIrU
Learn C# in One Video: Unity C# Scripting Tutorial for Beginners: https://www.youtube.com/watch?v=7gX-M26Oj1Y&list=PLytjVIyAOStpT8xJyijH4uG4nEPexvj18​​​​​​​

Scripting: "Scripting is an essential ingredient in all games. Even the simplest game needs scripts, to respond to input from the player and arrange for events in the gameplay to happen when they should. Beyond that, scripts can be used to create graphical effects, control the physical behavior of objects or even implement a custom AI system for characters in the game."

Scripts: "The behavior of GameObjects is controlled by the Components that are attached to them. Although Unity’s built-in Components can be very versatile, you will soon find you need to go beyond what they can provide to implement your own gameplay features. Unity allows you to create your own Components using scripts. These allow you to trigger game events, modify Component properties over time and respond to user input in any way you like.
Unlike most other assets, scripts are usually created within Unity directly. You can create a new script from the Create menu at the top left of the Project panel or by selecting Assets > Create > C# Script (or JavaScript) from the main menu.
The new script will be created in whichever folder you have selected in the Project panel. The new script file’s name will be selected, prompting you to enter a new name."

Script as Blueprint for Creating New Component: "A script makes its connection with the internal workings of Unity by implementing a class which derives from the built-in class called MonoBehaviour. You can think of a class as a kind of blueprint for creating a new Component type that can be attached to GameObjects. Each time you attach a script component to a GameObject, it creates a new instance of the object defined by the blueprint. The name of the class is taken from the name you supplied when the file was created. The class name and file name must be the same to enable the script component to be attached to a GameObject."

Two Default Functions, Update and Start: The main things to note, however, are the two functions defined inside the class. The Update function is the place to put code that will handle the frame update for the GameObject. This might include movement, triggering actions and responding to user input, basically anything that needs to be handled over time during gameplay. To enable the Update function to do its work, it is often useful to be able to set up variables, read preferences and make connections with other GameObjects before any game action takes place. The Start function will be called by Unity before gameplay begins (ie, before the Update function is called for the first time) and is an ideal place to do any initialization.

Back to Top