Programming in Unity refers to authoring your project’s functionality in code rather than through the Unity Editor UI. This allows you to go beyond what can be done in the Editor UI alone. Interacting directly with the public Unity APIs allows for finer control and a greater degree of customization.
Learning to program in particular languages is beyond the scope of this section. However, there are many books, tutorials, and other resources for learning how to program with Unity. Refer to Unity Learn for further details.
| Topic | Description |
|---|---|
| Get started with programming in Unity | Get started with creating, naming, and editing your first Unity scripts. |
| Programming with math | Use Unity’s mathematical APIs to apply trigonometric, logarithmic, and other functions in your application, move objects with vectors, and generate random values. |
| Control when your code updates | Understand the order in which Unity executes your script components and the lifecycle callbacks within those scripts during the runtime application loop. |
| Manage time and frame rate | Understand how Unity measures time so you can manage the rate at which time passes in your application and ensure values update according to the appropriate time scale. |
| Distribute work across threads | Move work off the main thread so that expensive operations don’t block frame updates. |
| Split tasks across frames with coroutines | Split the execution of a task synchronously across multiple scenes with coroutines. This can be useful for tasks that should progress gradually over several frames, such as a fade out effect. |
| Handle type data generically with Unity Properties | Use the Unity Properties API to generically discover and manipulate object properties at runtime. |
| Interacting with web servers | Use the UnityWebRequest system to allow your application to interact with a web server via HTTP. |